Author: raja
Date: 2005-05-05 05:01:36 -0400 (Thu, 05 May 2005)
New Revision: 44066
Added:
trunk/mcs/errors/CS0122-14-lib.cs
trunk/mcs/errors/CS0122-15-lib.cs
trunk/mcs/errors/cs0122-14.cs
trunk/mcs/errors/cs0122-15.cs
trunk/mcs/tests/test-374.cs
Modified:
trunk/mcs/errors/ChangeLog
trunk/mcs/errors/Makefile
trunk/mcs/errors/gmcs-expect-no-error
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/typemanager.cs
trunk/mcs/tests/ChangeLog
trunk/mcs/tests/Makefile
Log:
In mcs:
Fix reopened #64812.
* typemanager.cs (Closure.Filter): Introduce checks for 'protected
internal'.
In tests:
* test-374.cs: New test based on #64812.
In errors:
* Makefile (%-lib.dll, %-module.dll): Build during 'make test' or
'make run-test'.
* cs0122-14.cs, cs0122-15.cs, CS0122-14-lib.cs, CS0122-15-lib.cs:
New tests based on #64812.
Added: trunk/mcs/errors/CS0122-14-lib.cs
===================================================================
--- trunk/mcs/errors/CS0122-14-lib.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/CS0122-14-lib.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -0,0 +1,4 @@
+public class Test
+{
+ protected const int SomeValue = -1;
+}
Added: trunk/mcs/errors/CS0122-15-lib.cs
===================================================================
--- trunk/mcs/errors/CS0122-15-lib.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/CS0122-15-lib.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -0,0 +1,6 @@
+public class Test
+{
+ protected internal const int SomeValue = -1;
+}
+
+
Modified: trunk/mcs/errors/ChangeLog
===================================================================
--- trunk/mcs/errors/ChangeLog 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/ChangeLog 2005-05-05 09:01:36 UTC (rev 44066)
@@ -1,3 +1,11 @@
+2005-05-05 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * Makefile (%-lib.dll, %-module.dll): Build during 'make test' or
+ 'make run-test'.
+
+ * cs0122-14.cs, cs0122-15.cs, CS0122-14-lib.cs, CS0122-15-lib.cs:
+ New tests based on #64812.
+
2005-05-04 Raja R Harinath <[EMAIL PROTECTED]>
* cs0122-13.cs: New test based on #64812.
Modified: trunk/mcs/errors/Makefile
===================================================================
--- trunk/mcs/errors/Makefile 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/Makefile 2005-05-05 09:01:36 UTC (rev 44066)
@@ -27,12 +27,16 @@
generics-expect-no-error generics-expect-wrong-error \
$(wildcard known-issues-*)
-all-local: CS0118-2-lib.dll CS0122-10-lib.dll CS0534-3-lib.dll
CS0534-4-lib.dll CS0571-3-lib.dll \
+TEST_SUPPORT_FILES = \
+ CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll \
+ CS0534-3-lib.dll CS0534-4-lib.dll CS0571-3-lib.dll \
CS0612-2-lib.dll CS0618-2-lib.dll CS0619-8-lib.dll CS0619-17-lib.dll
CS0619-32-lib.dll CS0619-33-lib.dll CS0619-36-lib.dll \
CS3005-16-lib.dll CS3013-module.dll
-test-local: TestRunner-$(PROFILE).exe
+all-local:
+test-local: TestRunner-$(PROFILE).exe $(TEST_SUPPORT_FILES)
+
run-test-ondotnet-local:
# again, run-test is when the tests actually happen, so
@@ -54,6 +58,8 @@
TEST_PATTERN = 'cs*.cs'
endif
+run-mcs-tests: $(TEST_SUPPORT_FILES)
+
ifeq (net_2_0, $(PROFILE))
run-mcs-tests:
-rm -f gmcs.log
@@ -73,10 +79,10 @@
install-local uninstall-local:
%-lib.dll: %-lib.cs
- $(BOOTSTRAP_MCS) /target:library /out:$@ $<
+ $(CSCOMPILE) /target:library /out:$@ $<
%-module.dll: %-module.cs
- $(BOOTSTRAP_MCS) /target:module /out:$@ $<
+ $(CSCOMPILE) /target:module /out:$@ $<
TestRunner-$(PROFILE).exe: TestRunner.cs
$(CSCOMPILE) /out:$@ TestRunner.cs
Added: trunk/mcs/errors/cs0122-14.cs
===================================================================
--- trunk/mcs/errors/cs0122-14.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/cs0122-14.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -0,0 +1,10 @@
+// cs0122-14.cs: 'Test.SomeValue' is inaccessible due to its protection level
+// Line: 7
+// Compiler options: -r:CS0122-14-lib.dll
+
+public class MyEnum
+{
+ int Unknown = Test.SomeValue;
+ static void Main () {}
+}
+
Added: trunk/mcs/errors/cs0122-15.cs
===================================================================
--- trunk/mcs/errors/cs0122-15.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/errors/cs0122-15.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -0,0 +1,10 @@
+// cs0122-15.cs: 'Test.SomeValue' is inaccessible due to its protection level
+// Line: 7
+// Compiler options: -r:CS0122-15-lib.dll
+
+public class MyEnum
+{
+ int Unknown = Test.SomeValue;
+ static void Main () {}
+}
+
Modified: trunk/mcs/errors/gmcs-expect-no-error
===================================================================
--- trunk/mcs/errors/gmcs-expect-no-error 2005-05-05 08:53:34 UTC (rev
44065)
+++ trunk/mcs/errors/gmcs-expect-no-error 2005-05-05 09:01:36 UTC (rev
44066)
@@ -10,6 +10,7 @@
cs0029-3.cs
cs0035.cs
cs0121-3.cs
+cs0122-15.cs
cs0161-2.cs # new in GMCS
cs0186.cs
cs0229.cs
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/mcs/ChangeLog 2005-05-05 09:01:36 UTC (rev 44066)
@@ -1,3 +1,9 @@
+2005-05-05 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix reopened #64812.
+ * typemanager.cs (Closure.Filter): Introduce checks for 'protected
+ internal'.
+
2005-05-04 Raja R Harinath <[EMAIL PROTECTED]>
Abin Thomas <[EMAIL PROTECTED]>
Anoob V E <[EMAIL PROTECTED]>
Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/mcs/typemanager.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -2442,21 +2442,17 @@
return true;
// A nested class has access to all the protected
members visible to its parent.
- if (qualifier_type != null
- && TypeManager.IsNestedChildOf (invocation_type,
qualifier_type))
+ if (qualifier_type != null &&
TypeManager.IsNestedChildOf (invocation_type, qualifier_type))
return true;
- if (invocation_type == m.DeclaringType
- || invocation_type.IsSubclassOf (m.DeclaringType)) {
- if (is_static)
- return true;
-
+ if (invocation_type == m.DeclaringType ||
invocation_type.IsSubclassOf (m.DeclaringType)) {
// Although a derived class can access
protected members of its base class
// it cannot do so through an instance of the
base class (CS1540).
// => Ancestry should be: declaring_type ->*
invocation_type ->* qualified_type
- if (qualifier_type == null
- || qualifier_type == invocation_type
- || qualifier_type.IsSubclassOf
(invocation_type))
+ if (is_static ||
+ qualifier_type == null ||
+ qualifier_type == invocation_type ||
+ qualifier_type.IsSubclassOf
(invocation_type))
return true;
}
@@ -2493,21 +2489,20 @@
MethodAttributes ma = mb.Attributes &
MethodAttributes.MemberAccessMask;
if (ma == MethodAttributes.Private)
- return private_ok || (invocation_type
== m.DeclaringType) ||
+ return private_ok || invocation_type ==
m.DeclaringType ||
IsNestedChildOf
(invocation_type, m.DeclaringType);
-
- // Assembly succeeds if we're in the same
assembly.
- if (ma == MethodAttributes.Assembly)
- return (invocation_assembly ==
mb.DeclaringType.Assembly);
-
- // FamAndAssem requires that we not only
derive, but we are on the same assembly.
- if (ma == MethodAttributes.FamANDAssem){
- if (invocation_assembly !=
mb.DeclaringType.Assembly)
+
+ if (invocation_assembly ==
mb.DeclaringType.Assembly) {
+ if (ma == MethodAttributes.Assembly ||
ma == MethodAttributes.FamORAssem)
+ return true;
+ } else {
+ if (ma == MethodAttributes.Assembly ||
ma == MethodAttributes.FamANDAssem)
return false;
}
-
- // Family and FamANDAssem require that we
derive.
- if ((ma == MethodAttributes.Family) || (ma ==
MethodAttributes.FamANDAssem))
+
+ if (ma == MethodAttributes.Family ||
+ ma == MethodAttributes.FamANDAssem ||
+ ma == MethodAttributes.FamORAssem)
return CheckValidFamilyAccess
(mb.IsStatic, m);
// Public.
@@ -2521,19 +2516,18 @@
if (fa == FieldAttributes.Private)
return private_ok || (invocation_type
== m.DeclaringType) ||
IsNestedChildOf
(invocation_type, m.DeclaringType);
-
- // Assembly succeeds if we're in the same
assembly.
- if (fa == FieldAttributes.Assembly)
- return (invocation_assembly ==
fi.DeclaringType.Assembly);
-
- // FamAndAssem requires that we not only
derive, but we are on the same assembly.
- if (fa == FieldAttributes.FamANDAssem){
- if (invocation_assembly !=
fi.DeclaringType.Assembly)
+
+ if (invocation_assembly ==
fi.DeclaringType.Assembly) {
+ if (fa == FieldAttributes.Assembly ||
fa == FieldAttributes.FamORAssem)
+ return true;
+ } else {
+ if (fa == FieldAttributes.Assembly ||
fa == FieldAttributes.FamANDAssem)
return false;
}
-
- // Family and FamANDAssem require that we
derive.
- if ((fa == FieldAttributes.Family) || (fa ==
FieldAttributes.FamANDAssem))
+
+ if (fa == FieldAttributes.Family ||
+ fa == FieldAttributes.FamANDAssem ||
+ fa == FieldAttributes.FamORAssem)
return CheckValidFamilyAccess
(fi.IsStatic, m);
// Public.
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/tests/ChangeLog 2005-05-05 09:01:36 UTC (rev 44066)
@@ -1,3 +1,7 @@
+2005-05-05 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * test-374.cs: New test based on #64812.
+
2005-05-04 Martin Baulig <[EMAIL PROTECTED]>
* test-49.cs: Add testcase from 74655.
Modified: trunk/mcs/tests/Makefile
===================================================================
--- trunk/mcs/tests/Makefile 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/tests/Makefile 2005-05-05 09:01:36 UTC (rev 44066)
@@ -79,7 +79,7 @@
test-341 test-342 test-343 test-344 test-345 test-346 test-347 test-348
test-349 test-350 \
test-351 test-352 test-353 test-354 test-355 test-356 test-357 test-358
test-359 test-360 \
test-361 test-362 test-363 test-364 test-365 test-366 test-367 test-368
test-370 \
- test-371 test-373
\
+ test-371 test-373 test-374
\
cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-7
cls-test-10 \
cls-test-11 cls-test-12 cls-test-14 cls-test-15 cls-test-16 \
2test-1 2test-2 2test-3 2test-4 2test-5 2test-6 2test-7 2test-8
2test-9 2test-10 \
Added: trunk/mcs/tests/test-374.cs
===================================================================
--- trunk/mcs/tests/test-374.cs 2005-05-05 08:53:34 UTC (rev 44065)
+++ trunk/mcs/tests/test-374.cs 2005-05-05 09:01:36 UTC (rev 44066)
@@ -0,0 +1,10 @@
+internal class Test
+{
+ protected internal const int foo = 0;
+}
+internal class Rest
+{
+ protected const int foo = Test.foo;
+
+ static void Main () {}
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches