Question: NoMetadataRuntimeInterfacesAlgorithm
yowl opened this issue · comments
What would be an example of a type that fits this:
/// <summary>
/// Gets interface information from the RuntimeTypeHandle for a type with no metadata
/// </summary>
internal class NoMetadataRuntimeInterfacesAlgorithm : RuntimeInterfacesAlgorithm
{
?
The type system C# source code is shared between the compiler and the runtime type system.
The runtime type system is used to build new EETypes at runtime - mostly for things like MakeGenericType and MakeGenericMethod. If I remember correctly, in the runtime type system, all runtime types are represented as "no metadata types", because the amount of metadata we have is extremely limited (basically, we construct TypeDesc instances that are only backed by the EEType data structure - we can't answer questions such as: what are all the methods on this type?).
The class you're asking about is a good example of what that means: instead of having to compute the list of interfaces based on metadata (which would entail walking the list of interfaces introduced by each of the base classes), we just grab a precomputed list of interfaces from the EEType (because the data structure is already laid out to have all the runtime interfaces available because that's what we need for casting).
Thanks