[Mono-devel-list] [PATCH] Large patch for Reflection.Emit

Gert Driesen gert.driesen at pandora.be
Wed Jun 9 11:25:46 EDT 2004

----- Original Message -----
From: "Paolo Molaro" <lupus at ximian.com>
To: <mono-devel-list at lists.ximian.com>
Sent: Wednesday, June 09, 2004 5:04 PM
Subject: Re: [Mono-devel-list] [PATCH] Large patch for Reflection.Emit

> On 06/08/04 Gert Driesen wrote:
> > * EnumBuilder.cs: implemented EnumBuilder as wrapper class for
> > TypeBuilder, meaning rely on TypeBuilder implementation as
> > an enum is just a special type.
> >
> > * MethodBuilder.cs: move check to see if type has already up
> > to match MS.NET behaviour, fix GetHashCode (removed TODO)
> These look fine to commit. Please also commit the tests.

Is it ok to commit the unit tests, although they fail on the current
implementation of TypeBuilder/EnumBuilder ?  I guess so, no ?

> > * TypeBuilder.cs: removed code duplication as we do not need
> > to return methods/events/properties when type has not been
> > created, fixed Get* methods to return actual events/fields/...
> > when type has been completed, implemented IsCOMObjectImpl,
> > removed unnecessary FIXME's
> Most of the changes in TypeBuilder.cs look too intrusive this late
> in the release process and IIRC some of the code you remove was added
> because it was needed and we didn't want to match the MS misfeatures in
> some cases.

The MS implementation actually does not allow you to retrieve the members
(methods, events, ...) of a type until its actually created.  I think (but
I'm only guessing here) the reason why the Mono TypeBuilder had a lot of
additional code was because it did allow this, so it could not rely on the
created type for this.  I've changed the behaviour of TypeBuilder to match
the MS implementation.  This also avoids a lot of code duplication.

> I suggest you apply just the FIXME-removing hunks and the
> simple property fixes and save the rest of the patch in a bugzilla bug
> so it doesn't get lost.

Too bad, but I understand ...


More information about the Mono-devel-list mailing list