Bug 35236

Summary: Error CS0200 when attempting to override auto-implemented property.
Product: [Mono] Compilers Reporter: Dale Reidy <dalebreidy>
Component: C#Assignee: Marek Safar <masafa>
Severity: normal CC: mono-bugs+mono, pj.beaman, shrutis
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Dale Reidy 2015-10-24 15:50:58 UTC
- Description of Problem:

When overriding an abstract or virtual read only property where the base class lives within a separate assembly, the following error occurs:

Error CS0200: Property or indexer 'TestAssembly.Base.Value' cannot be assigned to (it is read-only) (CS0200)

- Steps to reproduce the problem:

1. Create base class in one assembly:

	public abstract class Base
		public abstract string Value { get; }

2. Create sub class in another assembly:

	public class Subclass : Base
		public override string Value { get; }

		public Subclass ()
			Value = "test";

3. Compile

- Actual Results:

This should compile with no error

- Expected Results:

It fails to compile with the above error, unless the Base class resides in the same assembly.

- How often does this happen? 

Consistently @ compile time

- Additional Information:

Tested on Linux Mint with alpha build:

Mono JIT compiler version 4.2.1 (Stable Tue Oct  6 14:40:19 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen

And on OSX, using build from here: http://download.mono-project.com/archive/4.2.1/macos-10-x86/MonoFramework-MDK-
Comment 1 Marek Safar 2015-10-26 11:46:33 UTC
Fixed in master/ef164ac483a67dc0f92f467a7a187c8f297e4117
Comment 2 Shruti 2015-10-28 03:40:44 UTC
Reproduce Status:
I have reproduced  this issue with implementing code described in Comment(0) using MonoFramework-MDK-
Screencast: http://www.screencast.com/t/tVqVWA0T0p

Reopen Status:
I have checked this issue with latest master we have MonoFramework-MDK-  and observed that this issue still exist with this Mono.

As per comment(1), this seems we don't have latest build to verify this.  But I am not sure about this So being now I am reopening this issue and will verify once I get the latest build.

Comment 3 Marek Safar 2015-10-29 03:50:22 UTC
What's the point of verifying this against 18 days old build when the fix was committed 2 days ago? You are wasting both your time and my time for no reason
Comment 4 Shruti 2015-10-29 04:15:02 UTC
Hey Marek,

Sorry for the inconvinience, We dont have build in 360 dropbox master folder after MonoFramework-MDK- I am also looking for the latest build in dropbox.
Comment 6 Shruti 2015-11-02 09:35:55 UTC
I have checked this issue with latest Master MonoFramework-MDK- and it is working fine. Now, I am not getting error 'Error CS0200: Property or indexer 'TestAssembly.Base.Value' cannot be assigned to (it is read-only) (CS0200)' after building the application.

Screencast: http://www.screencast.com/t/v9wITsYaBQCS
Environment Info: https://gist.github.com/shrutis360/f9d7f26a15bb659b2fb7

I will close this issue  when this issue will fix in C6 build.
Comment 7 Shruti 2015-11-04 03:06:17 UTC
This issue is working fine with latest C6 MonoFramework-MDK-

Environment Info:https://gist.github.com/shrutis360/ed20c5c335dd52fa5829