[Mono-bugs] [Bug 64812][Nor] Changed - mcs does not detect compilation error...

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 29 Dec 2004 11:11:21 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by duncan@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=64812

--- shadow/64812	2004-09-02 02:30:25.000000000 -0400
+++ shadow/64812.tmp.19022	2004-12-29 11:11:21.000000000 -0500
@@ -69,6 +69,53 @@
 Always
 
 Additional Information:
 mcs version 1.0.1.0 on Windows XP
 mcs version 1.1.1.0 on RH Linux
 .NET C# version 7.10.3052.4
+
+------- Additional Comments From duncan@ximian.com  2004-12-29 11:11 -------
+This bug still exists in current MCS.
+
+It even exists for fields in classes.
+
+class Test
+{
+	protected const int SomeValue = -1;
+        static void Main () {}
+}
+
+public class MyEnum
+{
+	int Unknown = Test.SomeValue;
+}
+
+The problem seems to come from the implementation of
+Expression.IsAccessorAccessible in ecore.cs. Specifically, I don't
+understand how, starting in line 236:
+
+//
+// (1) FamAndAssem requires that we not only derivate, but we are on the
+// same assembly.  
+//
+if (ma == MethodAttributes.FamANDAssem){
+	return (mi.DeclaringType.Assembly != invocation_type.Assembly);
+}
+
+// (2) Assembly and FamORAssem succeed if we're in the same assembly.
+if ((ma == MethodAttributes.Assembly) || (ma ==
+MethodAttributes.FamORAssem)){
+	if (mi.DeclaringType.Assembly == invocation_type.Assembly)
+		return true;
+}
+
+// (3) We already know that we aren't in the same assembly.
+if (ma == MethodAttributes.Assembly)
+	return false;
+
+// (4) Family and FamANDAssem require that we derive.
+if ((ma == MethodAttributes.Family) || (ma ==
+MethodAttributes.FamANDAssem) || (ma == MethodAttributes.FamORAssem)){
+
+I don't understand how we could ever reach test (4) other than when ma
+== MethodAttributes.Family, since tests (1) and (2) would have already
+ filtered out the cases FamANDAssem and FamORAssem.