3 ms·
> I'd be interested in an overview article about Mirror's features to compare. This article only talks about values. Does it include/support function info? Inhe
by slavapestov 8y ago
> I'd be interested in an overview article about Mirror's features to compare. This article only talks about values. Does it include/support function info? Inheritance? Can it be used to generate code like Reflection.Emit?
The compiler emits some metadata for each class, enum and struct with field types and other information, such as the superclass, protocol conformances, and virtual methods.
The standard library's Mirror type is a thin wrapper around some runtime functions that just lets you introspect the fields of a value. It's pretty limited in what it can do, but there is more metadata there for future use.