TypeReprMethods
Extension methods of TypeRepr.
Attributes
- Source
- Quotes.scala
- Graph
-
- Supertypes
Members list
Extensions
Extensions
Is this type a subtype of that type?
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
- Source
- Quotes.scala
The current type applied to given type arguments: this[targ].
The current type applied to given type arguments: this[targ].
Value parameters
- targ
-
the type argument to apply
Attributes
- Source
- Quotes.scala
The current type applied to given type arguments: this[targ0, ..., targN].
The current type applied to given type arguments: this[targ0, ..., targN].
Value parameters
- targs
-
the type arguments
Attributes
- Source
- Quotes.scala
Converts this TypeRepr to an Type[?]
Converts 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
- Returns
-
a
Type[?]representation of this type - Source
- Quotes.scala
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
- Source
- Quotes.scala
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]
Value parameters
- cls
-
the class symbol to compute the base type for
Attributes
- Source
- Quotes.scala
Attributes
- Source
- Quotes.scala
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
- Source
- Quotes.scala
Follow non-opaque aliases, annotated types until type is no longer alias type, annotated type.
Follow non-opaque aliases, annotated types until type is no longer alias type, annotated type.
Attributes
- Source
- Quotes.scala
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?
Value parameters
- cls
-
the class symbol to check against
Attributes
- Source
- Quotes.scala
Is this type an context function type?
Is this type a dependent function type?
Is this type a function type with erased parameters?
Is this type a function type with erased parameters?
Attributes
- See also
-
isFunctionType - Source
- Quotes.scala
Is this type a function type?
Is this type a function type?
Attributes
- Returns
-
true if the dealiased type of
selfwithout refinement isFunctionN[T1, T2, ..., Tn] - Note
-
The function
- returns true for
given Int => Intanderased Int => Int - returns false for
List[Int], despite thatList[Int] Int.
- returns true for
- Source
- Quotes.scala
Attributes
- Source
- Quotes.scala
Is this type a TupleN type?
Is this type a TupleN type?
Attributes
- Returns
-
true if the dealiased type of
selfisTupleN[T1, T2, ..., Tn] - Source
- Quotes.scala
The type of member as seen from prefix self.
The type of member as seen from prefix self.
Also see typeRef and termRef
Value parameters
- member
-
the member symbol whose type is to be computed
Attributes
- Returns
-
the type of the member as seen from this prefix type
- Source
- Quotes.scala
The type , reduced if possible.
The type , reduced if possible.
Value parameters
- sym
-
the member symbol to select
Attributes
- Source
- Quotes.scala
Shows the type as a String.
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
- Source
- Quotes.scala
Substitutes all types that refer in their symbol attribute to one of the symbols in from by the corresponding types in to.
Substitutes all types that refer in their symbol attribute to one of the symbols in from by the corresponding types in to.
Value parameters
- from
-
the list of symbols to substitute
- to
-
the list of replacement types corresponding to
from
Attributes
- Source
- Quotes.scala
Attributes
- Source
- Quotes.scala
The applied type arguments (empty if there is no such arguments).
Attributes
- Source
- Quotes.scala
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 .widen = o.C
Attributes
- Returns
-
the widened type
- Source
- Quotes.scala
Widen from ByName type to its result type.
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
- Source
- Quotes.scala