[Mono-bugs] [Bug 66246][Wis] New - [PATCH] improve CS1520 error's reported location
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 19 Sep 2004 15:30:48 -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 jluke@cfl.rr.com.
http://bugzilla.ximian.com/show_bug.cgi?id=66246
--- shadow/66246 2004-09-19 15:30:48.000000000 -0400
+++ shadow/66246.tmp.12100 2004-09-19 15:30:48.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 66246
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jluke@cfl.rr.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [PATCH] improve CS1520 error's reported location
+
+Given:
+static class T
+{
+ static void Main ()
+ {
+ }
+
+ static Foo () // missing return type on purpose
+ {
+ }
+}
+
+mcs currently reports:
+$ mcs t.cs
+Foo and T
+t.cs(1) error CS1520: Class, struct, or interface method must have a return
+type
+Compilation failed: 1 error(s), 0 warnings
+
+I would think it much more helpful if it reported:
+$ mcs t.cs
+Foo and T
+t.cs(7) error CS1520: Class, struct, or interface method must have a return
+type
+Compilation failed: 1 error(s), 0 warnings
+
+Attching a two-liner to change from using the class location, to
+Constructor.Location in the error report and comment that Console.WriteLine
+that prints 'Foo and T'