I'm making a .NET-compliant compiler using Reflection.Emit
. The problem is, that although TypeBuilder
is derived from Type
, it does not let me use all the handy methods that Type provides.
The matters that really concern me are:
Is there any way to get a list of methods, fields, properties, constructors etc. defined in a
TypeBuilder
, or I really have to make aTypeBuilderWrapper
that keeps track of all those entities by myself? It has to store them somewhere inside, so there must be some way to extract them?The
GetMethod
method is very handy, because it can find the best fitting method override taking inheritance and generic covariance into account. Do I really have to reimplement it myself for theTypeBuilderWrapper
?
The same issue probably applies to MethodBuilder
, FieldBuilder
etc. which, I believe, do not implement the lookup methods of MethodInfo
and FieldInfo
respectively.