Bug 9885 - MCS does not parse statement source locations as expected
Summary: MCS does not parse statement source locations as expected
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-01-29 20:06 UTC by Brett van Swelm
Modified: 2013-01-31 08:30 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Brett van Swelm 2013-01-29 20:06:31 UTC
MCS does not parse statement source locations as expected. To illustrate, we'll use a compiler error.

With "D:\Applications\Mono-2.11.4\bin" in the path on my Windows 7 machine:

===== Location.cs =====
public class Test {
    int x;
    public static void bad1(Test t) {
        t
        .
        x  // <- compiler error reported here (should be two lines up)
        ;
    }
    public static void bad2(Test t) {
        3  // <- compiler error reported here (as expected)
        +
        4
        ;
    }
}
===== end =====

$ mcs Location.cs
Location.cs(6,9): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Location.cs(10,9): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Compilation failed: 2 error(s), 0 warnings

Thanks,

Brett van Swelm | Senior Engineer
Coverity | 185 Berry Street | Suite 6500, Lobby 3 | San Francisco, CA 94107
The Leader in Development Testing
Read our profile in Forbes, Coverity Gets Code Right 25% Faster
Comment 1 Marek Safar 2013-01-31 08:30:09 UTC
Fixed in master