[Mono-bugs] [Bug 68790][Wis] New - mcs does not report error CS0197
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 26 Oct 2004 06:15:26 -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 06:15:26.000000000 -0400
+++ shadow/68790.tmp.9819 2004-10-26 06:15:26.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 68790
+Product: Mono: Compilers
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: Linux
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: rkumar@novell.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs does not report error CS0197
+
+Description of Problem:
+CSC generated CS0197 for following program,
+
+Steps to reproduce the problem:
+1. Try to compile the following program with mcs and csc.
+
+
+//////// start of the test
+
+using System;
+
+public struct Point
+{
+ private int x, y;
+
+ public Point (int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public bool IsEmpty {
+ get { return (x==0 && y==0); }
+ }
+}
+
+
+public class A : MarshalByRefObject
+{
+ public Point point = new Point (0,0);
+}
+
+public class Test
+{
+ public static void Main ()
+ {
+ A a = new A ();
+ if (a.point.IsEmpty) {
+ Console.WriteLine ("Point is empty.");
+ }
+ }
+}
+
+//////// end of the test
+
+Actual Results:
+mcs compiles this code silently and csc reports following error,
+
+error CS0197: Cannot pass 'A.point' as ref or out, because 'A.point' is a
+marshal-by-reference class
+
+Expected Results:
+I think we must report the error like CSC.
+
+How often does this happen?
+Always.
+
+Additional Information:
+If we don't inherit class A from MarshalByRefObject, CSC compiles the code
+without any problem.