[Mono-devel-list] patch for TypeBuilder.CreateType() and mcs

Atsushi Eno atsushi at ximian.com
Thu Mar 10 14:41:40 EST 2005


I noticed that TypeBuilder never throws InvalidOperationException
when CreateType() is invoked twice. It is because of this change:

2004-12-06  Ben Maurer  <bmaurer at ximian.com>
	* TypeBuilder.cs (CreateType): Creating a type twice does not
	throw in msft.

Well, this is correct for .NET 2.0.

To see what happens, try attached example.

MSDN documentation (still) says that it will throw the exception.

So, I think we could make compromised fix for them; just return
already-created type for NET_2_0, and throw exception otherwise.

I also noticed that GetMembers() never throws an exception in
TypeBuilder when there is not created type, but not sure if it
is intended. It might be too naive to fill the differences
between MS one. At least we should be very careful to change them
because mcs heavily depends on them. If it makes sense, I'll
track down more on this matter and file bugs.

For now, to apply this TypeBuilder fix, mcs is also needed to be
fixed (included in the patch).

Atsushi Eno
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: createtypetwice.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050311/78a4751b/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: create-type.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050311/78a4751b/attachment-0001.pl 

More information about the Mono-devel-list mailing list