[Mono-list] Bug: FieldInfo.GetValue on literal field run
Varga Zoltan
vargaz@freemail.hu
Fri, 19 Dec 2003 15:24:51 +0100 (CET)
Hi,
Fixed in CVS.
A bug reporting howto is here:
http://bugzilla.ximian.com/bug-HOWTO.html
bye
Zoltan
Jeroen Frijters <jeroen@sumatra.nl> =EDrta:
> Hi,
>=20
> Doing a FieldInfo.GetValue() on a literal field (a C#
const) will
> trigger the class constructor (.cctor) to run. .NET 1.0 &
1.1 do the
> same, but Whidbey doesn't do this anymore.
>=20
> I think the current Mono behavior is incorrect, it makes
writing a
> compiler using Reflection.Emit even harder than it already
is ;-)
> At the moment mcs triggers the class constructors in types
in referenced
> assemblies, if literal fields are accessed, this is
obviously not a good
> idea.
>=20
> A proposed patch is attached.
>=20
> Regards,
> Jeroen
> P.S. No, I'm not adding this to Bugzilla. I refuse to use
a bug tracking
> system that requires several weeks of study before it can
be used.
>=20