[Mono-devel-list] Re: [Mono-patches] r41659 - trunk/mcs/mcs

Raja R Harinath rharinath at novell.com
Fri Mar 11 00:52:21 EST 2005


Hi,

"Atsushi Enomoto (ginga at kit.hi-ho.ne.jp)" <atsushi at mono-cvs.ximian.com> writes:

> Modified:
>    trunk/mcs/mcs/ChangeLog
>    trunk/mcs/mcs/doc.cs
> Log:
> 2004-03-10  Atsushi Enomoto  <atsushi at ximian.com>
>
> 	* doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
> 	  fail. So invoke CreateType() in FindDocumentedType().

This is not the right thing, IMHO.  Why not use the MemberLookup like
the rest of the compiler?

>  			Type t = FindDocumentedTypeNonArray (mc, identifier, ds, cref);
> +			// This step is required to make sure that the Type can
> +			// lookup members. At least for events, non-created
> +			// TypeBuilders cannot lookup members.
> +			TypeBuilder tb = t as TypeBuilder;
> +			if (tb != null) {
> +#if NET_2_0
> +				if (!tb.IsCreated ())
> +					tb.CreateType ();
> +#else
> +				try {
> +					// FIXME: in the future CreateType() got
> +					// to throw exceptions, this line will
> +					// become so slow. In such case, avoid
> +					// exception by making use of some 
> +					// methods that are known to not throw
> +					// on "already created" TypeBuilders.
> +					tb.CreateType ();
> +				} catch (InvalidOperationException) {
> +				}
> +#endif
> +			}

The NET_2_0 define isn't used.

- Hari



More information about the Mono-devel-list mailing list