Bug 28772

Summary: New auto-implemented property error with the first C# 6.0 alpha update.
Product: [Mono] Compilers Reporter: Brian Berry <bberry>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: jahmai, john, mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Example project.

Description Brian Berry 2015-04-04 13:54:12 UTC
Found: Previously accepted code now results in what look like false positive errors.

Steps to reproduce:
  * Load the attached project under the first C# 6.0-bearing alpha release.
  * Build the project.

Result:

Program.cs(24,34): error CS8080: `CS6.AutoProperties.MainClass.Baz.Condition': Auto-implemented properties must override all accessors of the overridden property

Expected: No error.

Notes:

The simple case of an auto-implemented get-only property works fine (as noted).

In the abstract/overridden case, the override implements exactly the same set of accessors as prescribed by the abstract class.  The same construct worked fine up until this release.  So this is either a case of shouldn't-have-worked-before (past bug) or should-work-now (new bug).

Any insight appreciated.
Thanks!
Comment 1 Brian Berry 2015-04-04 13:55:32 UTC
Created attachment 10635 [details]
Example project.
Comment 2 Brian Berry 2015-04-04 14:04:19 UTC
Note that an initial workaround is to declare a public setter for the hierarchy, but this of course changes the contract from what was intended.
Comment 3 Brian Berry 2015-04-04 15:21:25 UTC
Note that MSVS 2015 CTP appears to accept this case just fine --- maybe just a case of some upstream Roslyn fixes that haven't yet been merged?
Comment 4 Marek Safar 2015-04-07 10:13:32 UTC
Fixed in master
Comment 5 John Colanduoni 2015-06-07 22:57:25 UTC
Has this fix been incorporated into any of the Mono releases? I am still having this issue running the MDK installed with the Alpha channel on OS X (4.0.1.44).
Comment 6 Marek Safar 2015-06-08 03:38:14 UTC
The fix will be included in Mono 4.2
Comment 7 Jahmai 2015-08-25 23:42:10 UTC
Is there a chance of merging this to 4.0? This effectively breaks a C# 6 language feature that is supposedly supported in 4.0 for any readonly overridable properties.