Author: raja
Date: 2005-05-05 05:46:42 -0400 (Thu, 05 May 2005)
New Revision: 44067

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/decl.cs
   trunk/mcs/tests/ChangeLog
   trunk/mcs/tests/Makefile
Log:
Fix #74797.
* mcs/decl.cs (DeclSpace.FamilyAccessible): Delegate accessibility
check to surrounding class.  A nested class can access everything
accessible by its surrounding class.
* tests/test-375.cs: New test from #74797.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-05-05 09:01:36 UTC (rev 44066)
+++ trunk/mcs/mcs/ChangeLog     2005-05-05 09:46:42 UTC (rev 44067)
@@ -1,5 +1,10 @@
 2005-05-05  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       Fix #74797.
+       * decl.cs (DeclSpace.FamilyAccessible): Delegate accessibility
+       check to surrounding class.  A nested class can access everything
+       accessible by its surrounding class.
+
        Fix reopened #64812.
        * typemanager.cs (Closure.Filter): Introduce checks for 'protected
        internal'.

Modified: trunk/mcs/mcs/decl.cs
===================================================================
--- trunk/mcs/mcs/decl.cs       2005-05-05 09:01:36 UTC (rev 44066)
+++ trunk/mcs/mcs/decl.cs       2005-05-05 09:46:42 UTC (rev 44067)
@@ -751,7 +751,13 @@
                            TypeBuilder.IsSubclassOf (declaring))
                                return true;
 
-                       return NestedAccessible (check_type);
+                       if (NestedAccessible (check_type))
+                               return true;
+
+                       if (Parent == null || Parent == RootContext.Tree.Types)
+                               return false;
+
+                       return Parent.FamilyAccessible (check_type);
                }
 
                // Access level of a type.

Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog   2005-05-05 09:01:36 UTC (rev 44066)
+++ trunk/mcs/tests/ChangeLog   2005-05-05 09:46:42 UTC (rev 44067)
@@ -1,5 +1,7 @@
 2005-05-05  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       * test-375.cs: New test from #74797.
+
        * test-374.cs: New test based on #64812.
 
 2005-05-04  Martin Baulig  <[EMAIL PROTECTED]>

Modified: trunk/mcs/tests/Makefile
===================================================================
--- trunk/mcs/tests/Makefile    2005-05-05 09:01:36 UTC (rev 44066)
+++ trunk/mcs/tests/Makefile    2005-05-05 09:46:42 UTC (rev 44067)
@@ -33,7 +33,7 @@
 # He may also move some to TEST_EXCLUDE_net_2_0 if some of the merges are 
inappropriate for GMCS.
 #
 NEW_TEST_SOURCES_common = test-336 test-369 cls-test-6 test-294 \
-       test-372
+       test-372 test-375
 
 #
 # Please do _not_ add any tests here - all new tests should go into 
NEW_TEST_SOURCES_common

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

Reply via email to