Author: mhabersack
Date: 2007-03-14 03:52:56 -0500 (Wed, 14 Mar 2007)
New Revision: 74240

Modified:
   trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
Log:
it should have come with the previous commit

Modified: 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-03-14 08:52:12 UTC (rev 74239)
+++ 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-03-14 08:52:56 UTC (rev 74240)
@@ -86,13 +86,14 @@
                        if (partialNameOverride [builder.ID] != null)
                                return;
 #endif
+                       MemberAttributes ma = MemberAttributes.Family;
                        currentLocation = builder.location;
-                       if (check && CheckBaseFieldOrProperty (builder.ID, 
builder.ControlType))
+                       if (check && CheckBaseFieldOrProperty (builder.ID, 
builder.ControlType, ref ma))
                                return; // The field or property already exists 
in a base class and is accesible.
 
                        CodeMemberField field;
                        field = new CodeMemberField 
(builder.ControlType.FullName, builder.ID);
-                       field.Attributes = MemberAttributes.Family;
+                       field.Attributes = ma;
 #if NET_2_0
                        if (partialClass != null)
                                partialClass.Members.Add (field);
@@ -101,7 +102,7 @@
                                mainClass.Members.Add (field);
                }
 
-               bool CheckBaseFieldOrProperty (string id, Type type)
+               bool CheckBaseFieldOrProperty (string id, Type type, ref 
MemberAttributes ma)
                {
                        FieldInfo fld = parser.BaseType.GetField (id, 
noCaseFlags);
 
@@ -121,10 +122,15 @@
                                return false;
 
                        if (!other.IsAssignableFrom (type)) {
+#if NET_2_0
+                               ma |= MemberAttributes.New;
+                               return false;
+#else
                                string msg = String.Format ("The base class 
includes the field '{0}', but its " +
                                                            "type '{1}' is not 
compatible with {2}",
                                                            id, other, type);
                                throw new ParseException (currentLocation, msg);
+#endif
                        }
 
                        return true;

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

Reply via email to