[Mono-bugs] [Bug 68790][Wis] Changed - mcs does not report error CS0197

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 27 Oct 2004 01:08:18 -0400 (EDT)


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 rkumar@novell.com.

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

--- shadow/68790	2004-10-26 08:40:57.000000000 -0400
+++ shadow/68790.tmp.25033	2004-10-27 01:08:18.000000000 -0400
@@ -112,6 +112,31 @@
    int Y { get { return y; }}
    static int y;
 }
 
 And say X.Foo.Y, will it allow that? The return value from X.Foo can 
 not be passed byref.
+
+------- Additional Comments From rkumar@novell.com  2004-10-27 01:08 -------
+I don't know about the reason for this, but CSC compiles this code 
+without a hitch in following two case, 1) if class A does not inherit 
+from MarshalByRefObject. OR, 2) if Point is a class instead of struct.
+So, the problem seems to be only with the testcase provided earlier 
+i.e. when we have a struct (value type) member in a 
+MarshalByRefObject class.
+
+To answer your question, following code gets compiled on CSC as well 
+as mcs without any problem,
+
+public struct X {
+   public static X Foo { get {return new X ();} }
+   public int Y { get { return y; }}
+   static int y = 0;
+}
+
+public class Test
+{
+   public static void Main ()
+   {
+      int ret = X.Foo.Y;
+   }
+}