Refinement

oxygen.meta.Meta.TypeRepr.Refinement
See theRefinement companion object
final case class Refinement(raw: quotes.reflect.Refinement) extends TypeRepr

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait TypeRepr
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def info: TypeRepr
def name: String

Inherited methods

def &&(that: TypeRepr): AndType

Attributes

Inherited from:
TypeRepr
def <:<(that: TypeRepr): Boolean

Is this type a subtype of that type?

Is this type a subtype of that type?

Attributes

Inherited from:
TypeRepr
def =:=(that: TypeRepr): Boolean

Is self type the same as that type? This is the case iff self <:< that and that <:< self.

Is self type the same as that type? This is the case iff self <:< that and that <:< self.

Attributes

Inherited from:
TypeRepr
def appliedTo(targ0: TypeRepr, targ1: TypeRepr, targN: TypeRepr*): TypeRepr

Attributes

Inherited from:
TypeRepr
def appliedTo(targs: List[TypeRepr]): TypeRepr

The current type applied to given type arguments: this[targ0, ..., targN]

The current type applied to given type arguments: this[targ0, ..., targN]

Attributes

Inherited from:
TypeRepr

The current type applied to given type arguments: this[targ]

The current type applied to given type arguments: this[targ]

Attributes

Inherited from:
TypeRepr
def asType: Type[_ <: AnyKind]

Convert this TypeRepr to an Type[?]

Convert this TypeRepr to an Type[?]

Usage:

import scala.quoted._
def f(using Quotes) = {
  val q: Quotes = summon[Quotes]
  import q.reflect._
  val typeRepr: TypeRepr = ???
  typeRepr.asType match
    case '[t] =>
      '{ val x: t = ??? }
}

Attributes

Inherited from:
TypeRepr
def asTyped[A]: Type[A]

Attributes

Inherited from:
TypeRepr
def baseClasses: List[Symbol]

The base classes of this type with the class itself as first element.

The base classes of this type with the class itself as first element.

Attributes

Inherited from:
TypeRepr
def baseType(cls: Symbol): TypeRepr

The least type instance of given class which is a super-type of this type. Example:

The least type instance of given class which is a super-type of this type. Example:

  class D[T]
  class C extends p.D[Int]
  ThisType(C).baseType(D) = p.D[Int]

Attributes

Inherited from:
TypeRepr
def classSymbol: Option[Symbol]

Attributes

Inherited from:
TypeRepr

Follow aliases, annotated types until type is no longer alias type, annotated type.

Follow aliases, annotated types until type is no longer alias type, annotated type.

Attributes

Inherited from:
TypeRepr
def derivesFrom(cls: Symbol): Boolean

Is this type an instance of a non-bottom subclass of the given class cls?

Is this type an instance of a non-bottom subclass of the given class cls?

Attributes

Inherited from:
TypeRepr
def isContextFunctionType: Boolean

Is this type an context function type?

Is this type an context function type?

Attributes

See also

isFunctionType

Inherited from:
TypeRepr

Is this type a dependent function type?

Is this type a dependent function type?

Attributes

See also

isFunctionType

Inherited from:
TypeRepr
def isErasedFunctionType: Boolean

Is this type a function type with erased parameters?

Is this type a function type with erased parameters?

Attributes

See also

isFunctionType

Inherited from:
TypeRepr
def isFunctionType: Boolean

Is this type a function type?

Is this type a function type?

Attributes

Returns

true if the dealiased type of self without refinement is FunctionN[T1, T2, ..., Tn]

Note

The function

  • returns true for given Int => Int and erased Int => Int
  • returns false for List[Int], despite that List[Int] <:< Int => Int.
Inherited from:
TypeRepr
def isSingleton: Boolean

Attributes

Inherited from:
TypeRepr
def isTupleN: Boolean

Is this type a TupleN type?

Is this type a TupleN type?

Attributes

Returns

true if the dealiased type of self is TupleN[T1, T2, ..., Tn]

Inherited from:
TypeRepr
def memberType(member: Symbol): TypeRepr

The type of member as seen from prefix self.

The type of member as seen from prefix self.

Also see typeRef and termRef

Attributes

Inherited from:
TypeRepr
final def optionalAnnotation[Annot : Type]: Option[Expr[Annot]]

Attributes

Inherited from:
TypeRepr
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def requiredAnnotation[Annot : Type]: Expr[Annot]

Attributes

Inherited from:
TypeRepr
def select(sym: Symbol): TypeRepr

The type <this . sym>, reduced if possible

The type <this . sym>, reduced if possible

Attributes

Inherited from:
TypeRepr
def show(using quotes.reflect.Printer[quotes.reflect.TypeRepr]): String

Shows the type as a String

Shows the type as a String

Attributes

Inherited from:
TypeRepr
def show2: String

Attributes

Inherited from:
TypeRepr
def show2(default: TypeRepr => String): String

Attributes

Inherited from:
TypeRepr

A simplified version of this type which is equivalent wrt =:= to this type. Reduces typerefs, applied match types, and and or types.

A simplified version of this type which is equivalent wrt =:= to this type. Reduces typerefs, applied match types, and and or types.

Attributes

Inherited from:
TypeRepr
def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr

Substitute all types that refer in their symbol attribute to one of the symbols in from by the corresponding types in to.

Substitute all types that refer in their symbol attribute to one of the symbols in from by the corresponding types in to.

Attributes

Inherited from:
TypeRepr

Attributes

Inherited from:
TypeRepr
def typeArgs: List[TypeRepr]

The applied type arguments (empty if there is no such arguments)

The applied type arguments (empty if there is no such arguments)

Attributes

Inherited from:
TypeRepr

Attributes

Inherited from:
TypeRepr

Attributes

Inherited from:
TypeRepr
final def typeTree: TypeTree

Attributes

Inherited from:
TypeRepr
final def typeType: Option[TypeType]

Attributes

Inherited from:
TypeRepr
final def typeTypeCase: Option[Case]

Attributes

Inherited from:
TypeRepr
final def typeTypeSealed: Option[Sealed]

Attributes

Inherited from:
TypeRepr

Widen from singleton type to its underlying non-singleton base type by applying one or more underlying dereferences, Also go from => T to T. Identity for all other types. Example:

Widen from singleton type to its underlying non-singleton base type by applying one or more underlying dereferences, Also go from => T to T. Identity for all other types. Example:

class Outer { class C ; val x: C } def o: Outer <o.x.type>.widen = o.C

Attributes

Inherited from:
TypeRepr

Widen from ByName type to its result type.

Widen from ByName type to its result type.

Attributes

Inherited from:
TypeRepr

Widen from TermRef to its underlying non-termref base type, while also skipping ByName types.

Widen from TermRef to its underlying non-termref base type, while also skipping ByName types.

Attributes

Inherited from:
TypeRepr
def ||(that: TypeRepr): OrType

Attributes

Inherited from:
TypeRepr