reflect.Package
An isolated runtime-compiled package.
Signature
class reflect.PackageAn isolated runtime-compiled package.
Source:<builtin>/reflect/reflect.bamlbytes 9508–13746
Fields
_inner
unknownStatic methods
_compile
(_finish
(compile
(Compiles files into an isolated package, resolving its dependencies
against packages.
Parameters
files: source text keyed by path, as the package'sbaml_src.packages: packages the source may depend on, keyed by the alias it imports them under.
Throws
reflect.errors.CompilationErrorif the source does not compile.- anything the package's top-level initialization throws, which is why
the clause is
unknown.
current
() -> reflect.Package throws neverThe package lexically enclosing this call site.
Instance methods
Exported class types, keyed by package-local name.
Diagnostics produced while compiling this package.
Exported enum types, keyed by package-local name.
Exported free-function signatures, keyed by package-local name.
The exported class called name, or null if the package exports none.
The exported enum called name, or null if the package exports none.
Extract an exported function through an ordinary function-type contract.
A lookup by name has nowhere to put type arguments, so an unspecialized generic function is refused here.
The exported interface called name, or null if the package exports
none.
Exported interface types, keyed by package-local name.
tests
(self) -> map<string, () -> null throws unknown> throws unknownBundled tests as directly invocable zero-argument callables.
with_types
(A package that exports everything this one does, plus types under
the given names, for a later Package.compile to mount: a bare class,
enum, interface, or alias declaration is re-exported under its name
(the same declaration, so a consumer that mounts both packages sees
one type), any other type is declared as an alias, and every
declaration a mounted type reaches is exported under its own name. A
name this package already exports is refused.
Implementations
reflect.AnyClass for T
Instance methods
The class declaration's schema metadata, or empty metadata when the runtime type is not a class.
Read a field as T. A missing field returns null; use has_field to
distinguish that case from a present field whose value is null.
Return a value-bound field handle, or null when no such field exists.
has_field
(self, name: string) -> bool throws neverWhether this value's runtime class declares a field called name.
false when the runtime type is not a class.
Reflected fields bound to this value for Field.value<T>().
name
(self) -> string throws neverThe rendered name of this value's concrete runtime type.
This value's concrete runtime type.
Source:<builtin>/reflect/reflect.bamlbytes 7833–7863
Related definitions
reflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.AnyClassreflect.class.Fieldreflect.class.Typereflect.CompileArtifactreflect.Diagnosticreflect.enum.Typereflect.errors.CompilationErrorreflect.errors.TypeMismatchreflect.function.Typereflect.interface.Typereflect.Metareflect.Typereflect.TypeView