[Mono-bugs] [Bug 69153][Nor] New - mcs improperly emits some properties

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 5 Nov 2004 15:37:29 -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 jluke@cfl.rr.com.

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

--- shadow/69153	2004-11-05 15:37:29.000000000 -0500
+++ shadow/69153.tmp.22113	2004-11-05 15:37:29.000000000 -0500
@@ -0,0 +1,63 @@
+Bug#: 69153
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jluke@cfl.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs improperly emits some properties
+
+This:
+using System;
+using System.Reflection;
+
+public class T : A, I2
+{
+	static void Main ()
+	{
+		MemberInfo[] members = typeof (T).GetMember ("I.get_Foo",
+BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
+		Console.WriteLine (members.Length);
+	}
+
+	public void Bar ()
+	{
+	}
+}
+
+public abstract class A : I
+{
+	public virtual int Foo {
+		get {
+			return 0;
+		}
+	}
+}
+
+public interface I2 : I
+{
+	void Bar ();
+}
+
+public interface I
+{
+	int Foo { get; }
+}
+
+
+print 0 with .net and csc
+and 1 with mcs and either runtime
+
+This is a problem with how the T.Foo is emitted
+by mcs.  The "hidden" get method is visible to reflection
+when it is compiled by mcs and causes monocop to fail
+a rule that is effected by this.