Bug 316066 (MONO66246) - [PATCH] improve CS1520 error's reported location
Summary: [PATCH] improve CS1520 error's reported location
Status: RESOLVED FIXED
Alias: MONO66246
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-19 22:30 UTC by John Luke
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
proposed patch (1.48 KB, patch)
2004-09-19 22:31 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:54:15 UTC


---- Reported by jluke@cfl.rr.com 2004-09-19 15:30:48 MST ----

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'



---- Additional Comments From jluke@cfl.rr.com 2004-09-19 15:31:29 MST ----

Created an attachment (id=166808)
proposed patch




---- Additional Comments From miguel@ximian.com 2004-09-20 13:14:14 MST ----

Thanks, applied to CVS

Imported an attachment (id=166808)

Unknown operating system unknown. Setting to default OS "Other".