Imagine that you want to emit 2 types (enum type & class type which have one
static const field which fieldType is enum type).
Sth like that
-----------------
enum E : short{
one, two
}
class C{
const static E e = E.one
}
-------------
I'm trying to set literal field using fieldBuilder.SetConstant.
So my "pseudocode":
define E
E.create()
define C
C.defne(e)
e.setConstant(Enum.parse(C, "one"));
and i get exception
-------------------------------
Unhandled Exception: System.ArgumentException: Type must be a type provided
by t
he runtime, not a TypeDelegator, etc.
Parameter name: enumType
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at System.Enum.Parse(Type enumType, String value)
------------------------------
Quetion : how to create object of enum type which is emitted too?
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.