Author: miguel
Date: 2006-01-29 18:55:41 -0500 (Sun, 29 Jan 2006)
New Revision: 56232

Modified:
   branches/mono-1-1-13/mcs/gmcs/ChangeLog
   branches/mono-1-1-13/mcs/gmcs/class.cs
   branches/mono-1-1-13/mcs/gmcs/doc.cs
   branches/mono-1-1-13/mcs/gmcs/ecore.cs
   branches/mono-1-1-13/mcs/gmcs/generic.cs
   branches/mono-1-1-13/mcs/gmcs/typemanager.cs
   branches/mono-1-1-13/mcs/mcs/ChangeLog
   branches/mono-1-1-13/mcs/mcs/class.cs
   branches/mono-1-1-13/mcs/mcs/doc.cs
   branches/mono-1-1-13/mcs/mcs/ecore.cs
   branches/mono-1-1-13/mcs/mcs/typemanager.cs
Log:
Backport last 3 fixes to branch

Modified: branches/mono-1-1-13/mcs/gmcs/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/ChangeLog     2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/gmcs/ChangeLog     2006-01-29 23:55:41 UTC (rev 
56232)
@@ -1,3 +1,25 @@
+2006-01-29  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix part of #77397
+       * generic.cs (TypeManager.IsByRef): Handle pass-by-ref types.
+
+2006-01-28  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * typemanager.cs (GenericParameterPosition): New.
+       * doc.cs: Use it.
+
+2006-01-28  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * doc.cs : To process "include" elements, first we should create
+         another list than XmlNodeList, because it could result in node
+         removal, which could result in that the XmlNodeList gives up
+         yielding next node.
+
+2006-01-25  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * expression.cs: Introduce an error report that we were not
+       catching before.   Gonzalo ran into it.
+
 2006-01-23  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        A fix for bug: #76957

Modified: branches/mono-1-1-13/mcs/gmcs/class.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/class.cs      2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/gmcs/class.cs      2006-01-29 23:55:41 UTC (rev 
56232)
@@ -2838,6 +2838,13 @@
                        else
                                accmods = Modifiers.PRIVATE;
 
+                       // FIXME: remove this nasty fix for bug #77370 when
+                       // we get good AllowModifiersProp implementation.
+                       if ((mod & Modifiers.STATIC) != 0) {
+                               AllowedModifiers |= Modifiers.STATIC;
+                               AllowedModifiers &= ~ (Modifiers.ABSTRACT | 
Modifiers.SEALED);
+                       }
+
                        this.ModFlags = Modifiers.Check (AllowedModifiers, mod, 
accmods, Location);
                        this.OriginalModFlags = mod;
                }

Modified: branches/mono-1-1-13/mcs/gmcs/doc.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/doc.cs        2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/gmcs/doc.cs        2006-01-29 23:55:41 UTC (rev 
56232)
@@ -161,8 +161,16 @@
                                        mc.OnGenerateDocComment (ds, el);
 
                                        // FIXME: it could be done with 
XmlReader
-                                       foreach (XmlElement inc in 
n.SelectNodes (".//include"))
-                                               HandleInclude (mc, inc);
+                                       XmlNodeList nl = n.SelectNodes 
(".//include");
+                                       if (nl.Count > 0) {
+                                               // It could result in current 
node removal, so prepare another list to iterate.
+                                               ArrayList al = new ArrayList 
(nl.Count);
+                                               foreach (XmlNode inc in nl)
+                                                       al.Add (inc);
+                                               foreach (XmlElement inc in al)
+                                                       if (!HandleInclude (mc, 
inc))
+                                                               
inc.ParentNode.RemoveChild (inc);
+                                       }
 
                                        // FIXME: it could be done with 
XmlReader
                                        DeclSpace dsTarget = mc as DeclSpace;
@@ -191,17 +199,20 @@
                // Processes "include" element. Check included file and
                // embed the document content inside this documentation node.
                //
-               private static void HandleInclude (MemberCore mc, XmlElement el)
+               private static bool HandleInclude (MemberCore mc, XmlElement el)
                {
+                       bool keepIncludeNode = false;
                        string file = el.GetAttribute ("file");
                        string path = el.GetAttribute ("path");
                        if (file == "") {
                                Report.Warning (1590, 1, mc.Location, "Invalid 
XML `include' element. Missing `file' attribute");
                                el.ParentNode.InsertBefore 
(el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
+                               keepIncludeNode = true;
                        }
                        else if (path == "") {
                                Report.Warning (1590, 1, mc.Location, "Invalid 
XML `include' element. Missing `path' attribute");
                                el.ParentNode.InsertBefore 
(el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
+                               keepIncludeNode = true;
                        }
                        else {
                                XmlDocument doc = 
RootContext.Documentation.StoredDocuments [file] as XmlDocument;
@@ -215,7 +226,6 @@
                                                Report.Warning (1592, 1, 
mc.Location, "Badly formed XML in included comments file -- `{0}'", file);
                                        }
                                }
-                               bool keepIncludeNode = false;
                                if (doc != null) {
                                        try {
                                                XmlNodeList nl = 
doc.SelectNodes (path);
@@ -231,9 +241,8 @@
                                                Report.Warning (1589, 1, 
mc.Location, "Unable to include XML fragment `{0}' of file `{1}' ({2})", path, 
file, ex.Message);
                                        }
                                }
-                               if (!keepIncludeNode)
-                                       el.ParentNode.RemoveChild (el);
                        }
+                       return keepIncludeNode;
                }
 
                //
@@ -885,7 +894,7 @@
                static string GetSignatureForDoc (Type type)
                {
                        return TypeManager.IsGenericParameter (type) ?
-                               "`" + type.GenericParameterPosition :
+                               "`" + TypeManager.GenericParameterPosition 
(type) :
                                type.FullName.Replace ("+", ".").Replace ('&', 
'@');
                }
 

Modified: branches/mono-1-1-13/mcs/gmcs/ecore.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/ecore.cs      2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/gmcs/ecore.cs      2006-01-29 23:55:41 UTC (rev 
56232)
@@ -242,8 +242,11 @@
 
                        FullNamedExpression fne = ResolveAsTypeStep (ec, 
silent);
 
-                       if (fne == null)
+                       if (fne == null){
+                               if (!silent && errors == Report.Errors)
+                                       Report.Error (118, loc, "Expecting a 
type.");
                                return null;
+                       }
 
                        if (fne.eclass != ExprClass.Type) {
                                if (!silent && (errors == Report.Errors))

Modified: branches/mono-1-1-13/mcs/gmcs/generic.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/generic.cs    2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/gmcs/generic.cs    2006-01-29 23:55:41 UTC (rev 
56232)
@@ -2075,6 +2075,9 @@
                                return IsEqual (a.GetElementType (), 
b.GetElementType ());
                        }
 
+                       if (a.IsByRef && b.IsByRef)
+                               return IsEqual (a.GetElementType (), 
b.GetElementType ());
+
                        if (a.IsGenericType && b.IsGenericType) {
                                if (a.GetGenericTypeDefinition () != 
b.GetGenericTypeDefinition ())
                                        return false;

Modified: branches/mono-1-1-13/mcs/gmcs/typemanager.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/typemanager.cs        2006-01-29 23:55:21 UTC 
(rev 56231)
+++ branches/mono-1-1-13/mcs/gmcs/typemanager.cs        2006-01-29 23:55:41 UTC 
(rev 56232)
@@ -2443,6 +2443,11 @@
                return type.IsGenericParameter;
        }
 
+       public static int GenericParameterPosition (Type type)
+       {
+               return type.GenericParameterPosition;
+       }
+
 #region MemberLookup implementation
        
        //

Modified: branches/mono-1-1-13/mcs/mcs/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/mcs/ChangeLog      2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/mcs/ChangeLog      2006-01-29 23:55:41 UTC (rev 
56232)
@@ -1,3 +1,23 @@
+2006-01-28  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * typemanager.cs (GenericParameterPosition): New.
+       * doc.cs: Use it.
+
+2006-01-28  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * doc.cs : To process "include" elements, first we should create
+         another list than XmlNodeList, because it could result in node
+         removal, which could result in that the XmlNodeList gives up
+         yielding next node.
+
+         (Also made code identical to gmcs again.)
+
+2006-01-25  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * ecore.cs: Introduce an error report that we were not catching
+       before, if not silent, we must report the error.  Gonzalo ran into
+       it.
+
 2006-01-23  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        A fix for bug: #76957

Modified: branches/mono-1-1-13/mcs/mcs/class.cs
===================================================================
--- branches/mono-1-1-13/mcs/mcs/class.cs       2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/mcs/class.cs       2006-01-29 23:55:41 UTC (rev 
56232)
@@ -2666,6 +2666,13 @@
                        else
                                accmods = Modifiers.PRIVATE;
 
+                       // FIXME: remove this nasty fix for bug #77370 when
+                       // we get good AllowModifiersProp implementation.
+                       if ((mod & Modifiers.STATIC) != 0) {
+                               AllowedModifiers |= Modifiers.STATIC;
+                               AllowedModifiers &= ~ (Modifiers.ABSTRACT | 
Modifiers.SEALED);
+                       }
+
                        this.ModFlags = Modifiers.Check (AllowedModifiers, mod, 
accmods, Location);
                        this.OriginalModFlags = mod;
                }

Modified: branches/mono-1-1-13/mcs/mcs/doc.cs
===================================================================
--- branches/mono-1-1-13/mcs/mcs/doc.cs 2006-01-29 23:55:21 UTC (rev 56231)
+++ branches/mono-1-1-13/mcs/mcs/doc.cs 2006-01-29 23:55:41 UTC (rev 56232)
@@ -161,8 +161,16 @@
                                        mc.OnGenerateDocComment (ds, el);
 
                                        // FIXME: it could be done with 
XmlReader
-                                       foreach (XmlElement inc in 
n.SelectNodes (".//include"))
-                                               HandleInclude (mc, inc);
+                                       XmlNodeList nl = n.SelectNodes 
(".//include");
+                                       if (nl.Count > 0) {
+                                               // It could result in current 
node removal, so prepare another list to iterate.
+                                               ArrayList al = new ArrayList 
(nl.Count);
+                                               foreach (XmlNode inc in nl)
+                                                       al.Add (inc);
+                                               foreach (XmlElement inc in al)
+                                                       if (!HandleInclude (mc, 
inc))
+                                                               
inc.ParentNode.RemoveChild (inc);
+                                       }
 
                                        // FIXME: it could be done with 
XmlReader
                                        DeclSpace dsTarget = mc as DeclSpace;
@@ -191,17 +199,20 @@
                // Processes "include" element. Check included file and
                // embed the document content inside this documentation node.
                //
-               private static void HandleInclude (MemberCore mc, XmlElement el)
+               private static bool HandleInclude (MemberCore mc, XmlElement el)
                {
+                       bool keepIncludeNode = false;
                        string file = el.GetAttribute ("file");
                        string path = el.GetAttribute ("path");
                        if (file == "") {
                                Report.Warning (1590, 1, mc.Location, "Invalid 
XML `include' element. Missing `file' attribute");
                                el.ParentNode.InsertBefore 
(el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
+                               keepIncludeNode = true;
                        }
                        else if (path == "") {
                                Report.Warning (1590, 1, mc.Location, "Invalid 
XML `include' element. Missing `path' attribute");
                                el.ParentNode.InsertBefore 
(el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
+                               keepIncludeNode = true;
                        }
                        else {
                                XmlDocument doc = 
RootContext.Documentation.StoredDocuments [file] as XmlDocument;
@@ -215,7 +226,6 @@
                                                Report.Warning (1592, 1, 
mc.Location, "Badly formed XML in included comments file -- `{0}'", file);
                                        }
                                }
-                               bool keepIncludeNode = false;
                                if (doc != null) {
                                        try {
                                                XmlNodeList nl = 
doc.SelectNodes (path);
@@ -231,9 +241,8 @@
                                                Report.Warning (1589, 1, 
mc.Location, "Unable to include XML fragment `{0}' of file `{1}' ({2})", path, 
file, ex.Message);
                                        }
                                }
-                               if (!keepIncludeNode)
-                                       el.ParentNode.RemoveChild (el);
                        }
+                       return keepIncludeNode;
                }
 
                //
@@ -885,7 +894,7 @@
                static string GetSignatureForDoc (Type type)
                {
                        return TypeManager.IsGenericParameter (type) ?
-                               type.Name :
+                               "`" + TypeManager.GenericParameterPosition 
(type) :
                                type.FullName.Replace ("+", ".").Replace ('&', 
'@');
                }
 

Modified: branches/mono-1-1-13/mcs/mcs/ecore.cs
===================================================================
--- branches/mono-1-1-13/mcs/mcs/ecore.cs       2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/mcs/ecore.cs       2006-01-29 23:55:41 UTC (rev 
56232)
@@ -234,8 +234,11 @@
 
                        FullNamedExpression fne = ResolveAsTypeStep (ec, 
silent);
 
-                       if (fne == null)
+                       if (fne == null){
+                               if (!silent && errors == Report.Errors)
+                                       Report.Error (118, loc, "Expecting a 
type.");
                                return null;
+                       }
 
                        if (fne.eclass != ExprClass.Type) {
                                if (!silent && errors == Report.Errors)

Modified: branches/mono-1-1-13/mcs/mcs/typemanager.cs
===================================================================
--- branches/mono-1-1-13/mcs/mcs/typemanager.cs 2006-01-29 23:55:21 UTC (rev 
56231)
+++ branches/mono-1-1-13/mcs/mcs/typemanager.cs 2006-01-29 23:55:41 UTC (rev 
56232)
@@ -2117,6 +2117,11 @@
                return false;
        }
 
+       public static int GenericParameterPosition (Type type)
+       {
+               throw new InternalErrorException ("should not be called");
+       }
+
 #region MemberLookup implementation
        
        //

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

Reply via email to