scala.quoted.Quotes.reflectModule.TypeReprMethods
Extension methods of TypeRepr
Is this type a subtype of that type?
Is this type a subtype of that type?
AttributesIs 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
.
The current type applied to given type arguments: this[targ]
The current type applied to given type arguments: this[targ]
The current type applied to given type arguments: this[targ0, ..., targN]
The current type applied to given type arguments: this[targ0, ..., targN]
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
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.
AttributesThe 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
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.
AttributesFollow 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.
AttributesIs 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
?
Is this type an context function type?
Is this type an context function type?
AttributesIs this type a dependent function type?
Is this type a dependent function type?
AttributesIs this type a function type with erased parameters?
Is this type a function type with erased parameters?
AttributesIs this type a function type?
Is this type a function type?
Attributestrue if the dealiased type of self
without refinement is FunctionN[T1, T2, ..., Tn]
The function
given Int => Int
and erased Int => Int
List[Int]
, despite that List[Int] <:< Int => Int
.Is this type a TupleN
type?
Is this type a TupleN
type?
true if the dealiased type of self
is TupleN[T1, T2, ..., Tn]
The type of member
as seen from prefix self
.
The type of member
as seen from prefix self
.
Also see typeRef
and termRef
The type <this . sym>, reduced if possible
The type <this . sym>, reduced if possible
AttributesShows 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.
AttributesSubstitute 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
.
The applied type arguments (empty if there is no such arguments)
The applied type arguments (empty if there is no such arguments)
AttributesWiden 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
AttributesWiden from ByName type to its result type.
Widen from ByName type to its result type.
AttributesWiden 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.
AttributesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4