[Mono-devel-list] patch for TypeBuilder.CreateType() and mcs
Raja R Harinath
rharinath at novell.com
Fri Mar 11 01:08:03 EST 2005
Hi,
Raja R Harinath <rharinath at novell.com> writes:
> Atsushi Eno <atsushi at ximian.com> writes:
>
>> Index: mcs/class.cs
>> ===================================================================
>> --- mcs/class.cs (revision 41656)
>> +++ mcs/class.cs (working copy)
>> @@ -2118,7 +2118,15 @@
>>
>> try {
>> caching_flags |= Flags.CloseTypeCreated;
>> - TypeBuilder.CreateType ();
>> +#if NET_2_0
>> + if (!TypeBuilder.IsCreated ())
>> + TypeBuilder.CreateType ();
>> +#else
>> + try {
>> + TypeBuilder.CreateType ();
>> + } catch (InvalidOperationException) {
>> + }
>> +#endif
>> } catch (TypeLoadException){
>> //
>> // This is fine, the code still created the type
>
> The NET_2_0 define isn't meaningful in the current mcs code. Does the
>
> try ... catch
>
> version above also work with the .NET 2.0 profile? I suspect it does.
> If so, that's the code that should go into mcs.
>
> For 'gmcs', we can use the NET_2_0 variant, again without the #if.
Anyway, from what I suspect, based on Eno's (reverted) fix to doc.cs,
that we shouldn't be worrying about this. Lets not put this in, ever,
into mcs :-)
- Hari
More information about the Mono-devel-list
mailing list