Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Getter-only auto properties is a new language feature in C# 6.0. See http://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx.
The bug is, when using getter-only auto properties, which the name of property is the same with some class, CS0118 and CS0131 will occur.
The attached test file can be compiled in Visual Studio 2015 RC developer command prompt, but can not in Mono command prompt.
D:\>csc /target:library test.cs
Microsoft (R) Visual C# Compiler version 18.104.22.168411
Copyright (C) Microsoft Corporation. All rights reserved.
d:\>mcs -target:library test.cs
test.cs(16,9): error CS0118: `Foo' is a `type' but a `variable' was expected
test.cs(16,9): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Compilation failed: 2 error(s), 0 warnings
Created attachment 11318 [details]
*** This bug has been marked as a duplicate of bug 29691 ***