reflect.TypeView
Any `type` value: `reflect.Type` itself and every reflection kind view.
Signature
interface reflect.TypeViewAny type value: reflect.Type itself and every reflection kind view.
Every reflection API that takes a type takes a TypeView, so a kind view
goes wherever a reflect.Type does, and so does a class of your own that
implements TypeView: the API calls its as_type(). The shared type
operations below are default methods that run on the wrapped type value;
reflect.Type declares its own. to_string comes from baml.ToString,
which reflect.Type and every kind view implement.
Source:<builtin>/reflect/reflect.bamlbytes 3634–5919
Required instance methods
The type value this view wraps, restoring the unnarrowed type.
reflect.Type returns itself.
Default instance methods
Construct an array type whose element is this type.
implemented_by
(self, other: reflect.TypeView) -> bool throws neverReverse of implements: iface.implemented_by(t) is the same as
t.implements(iface). false when this type is not an interface, or
when other is not a concrete type.
implements
(self, other: reflect.TypeView) -> bool throws neverTrue iff this type nominally implements the interface other. Any
concrete type can: a class, an enum, a primitive, a list, a map, ...
other pins the interface's associated types (an omitted one takes
its default), and only an implementation with exactly those matches:
see reflect.Type.implements. false when other is not an
interface, or when this type is not a concrete type.
Returns the precise kind view of this type value.
meta
(Pair this type value with schema metadata without changing its identity.
Construct the canonical union of this type and null.
Render deterministic canonical BAML source for this definition. Non-equivalent declarations with the same display name are rejected.
Related definitions
reflect.Arrayreflect.Classreflect.Enumreflect.errors.CompilationErrorreflect.Functionreflect.Interfacereflect.Literalreflect.Mapreflect.Primitivereflect.Typereflect.TypeKindreflect.Unionreflect.WithMetareflect.Arrayreflect.Classreflect.Enumreflect.Functionreflect.Interfacereflect.Literalreflect.Mapreflect.Primitivereflect.Typereflect.Union