Author: atsushi
Date: 2005-03-10 13:54:56 -0500 (Thu, 10 Mar 2005)
New Revision: 41659

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/doc.cs
Log:
2004-03-10  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
          fail. So invoke CreateType() in FindDocumentedType().



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-03-10 17:58:35 UTC (rev 41658)
+++ trunk/mcs/mcs/ChangeLog     2005-03-10 18:54:56 UTC (rev 41659)
@@ -1,5 +1,10 @@
 2004-03-10  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
+         fail. So invoke CreateType() in FindDocumentedType().
+
+2004-03-10  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * cs-tokenizer.cs : added IsKeyword().
        * doc.cs : Detect keyword incorrectly used as identifier.
          Allow identifiers prefixed by @.

Modified: trunk/mcs/mcs/doc.cs
===================================================================
--- trunk/mcs/mcs/doc.cs        2005-03-10 17:58:35 UTC (rev 41658)
+++ trunk/mcs/mcs/doc.cs        2005-03-10 18:54:56 UTC (rev 41659)
@@ -275,6 +275,27 @@
                                }
                        }
                        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
+                       }
                        if (t != null && isArray)
                                t = Array.CreateInstance (t, 0).GetType ();
                        return t;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to