Author: martin
Date: 2006-09-18 20:30:13 -0400 (Mon, 18 Sep 2006)
New Revision: 65618

Added:
   trunk/mcs/tests/gtest-288.cs
Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/ecore.cs
Log:
2006-09-19  Martin Baulig  <[EMAIL PROTECTED]>

        * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2006-09-19 00:24:31 UTC (rev 65617)
+++ trunk/mcs/gmcs/ChangeLog    2006-09-19 00:30:13 UTC (rev 65618)
@@ -1,5 +1,9 @@
 2006-09-19  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
+
+2006-09-19  Martin Baulig  <[EMAIL PROTECTED]>
+
        * typemanager.cs: Removed; this file is now shared with mcs.
 
 2006-09-16  Raja R Harinath  <[EMAIL PROTECTED]>

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2006-09-19 00:24:31 UTC (rev 65617)
+++ trunk/mcs/gmcs/ecore.cs     2006-09-19 00:30:13 UTC (rev 65618)
@@ -3648,10 +3648,10 @@
 
                        InstanceExpression.CheckMarshalByRefAccess ();
 
-                       if (must_do_cs1540_check && InstanceExpression != 
EmptyExpression.Null &&
-                           InstanceExpression.Type != ec.ContainerType &&
-                           ec.ContainerType.IsSubclassOf 
(PropertyInfo.DeclaringType) &&
-                           !InstanceExpression.Type.IsSubclassOf 
(ec.ContainerType)) {
+                       if (must_do_cs1540_check && (InstanceExpression != 
EmptyExpression.Null) &&
+                           !TypeManager.IsInstantiationOfSameGenericType 
(InstanceExpression.Type, ec.ContainerType) &&
+                           TypeManager.IsFamilyAccessible (ec.ContainerType, 
PropertyInfo.DeclaringType) &&
+                           !TypeManager.IsFamilyAccessible 
(InstanceExpression.Type, ec.ContainerType)) {
                                Error_CannotAccessProtected (loc, PropertyInfo, 
InstanceExpression.Type, ec.ContainerType);
                                return false;
                        }

Added: trunk/mcs/tests/gtest-288.cs
===================================================================
--- trunk/mcs/tests/gtest-288.cs        2006-09-19 00:24:31 UTC (rev 65617)
+++ trunk/mcs/tests/gtest-288.cs        2006-09-19 00:30:13 UTC (rev 65618)
@@ -0,0 +1,31 @@
+using System;
+
+public abstract class A
+{
+       protected bool Test (int a)
+       {
+               return a == 5;
+       }
+}
+
+public class B : A
+{
+       public void Test ()
+       { }
+
+       class C : A
+       {
+               B b;
+
+               public bool Foo (int a)
+               {
+                       return b.Test (a);
+               }
+       }
+}
+
+class X
+{
+       static void Main ()
+       { }
+}


Property changes on: trunk/mcs/tests/gtest-288.cs
___________________________________________________________________
Name: svn:executable
   + *

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

Reply via email to