[Mono-bugs] [Bug 31910][Nor] New - crash when trying to compile class that has a property and method with same name

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
8 Oct 2002 03:14:55 -0000


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 vladimir@pobox.com.

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

--- shadow/31910	Mon Oct  7 23:14:55 2002
+++ shadow/31910.tmp.7560	Mon Oct  7 23:14:55 2002
@@ -0,0 +1,41 @@
+Bug#: 31910
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: crash when trying to compile class that has a property and method with same name
+
+/** startsource **/
+class Driver {
+    public static int Foo {
+        get {
+            return 1;
+        }
+    }
+
+    public static int Foo (int j) {
+        return j;
+    }
+
+    public static void Main () {
+        int i = Foo;
+        int j = Foo(5);
+    }
+}
+/** endsource **/
+
+without access of Foo/Foo(5), it compiles fine with mcs.  csc gives a "The
+class 'Driver' already contains a definition for Foo" error.  With just
+"int i = Foo", an error is given in mcs, that Foo is referenced without
+()'s.  With both the i and j assignments, mcs segfaults. :)