Bug 35236 - Error CS0200 when attempting to override auto-implemented property.
Summary: Error CS0200 when attempting to override auto-implemented property.
Status: VERIFIED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-10-24 15:50 UTC by Dale Reidy
Modified: 2015-11-04 03:06 UTC (History)
3 users (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:
VERIFIED FIXED

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 4.2.1.60/804ddbc 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-4.2.1.60.macos10.xamarin.x86.pkg
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-4.2.1.60.macos10.xamarin.x86_c75e47b5249ac89e2da883bb570d1d4d4a90b334
Screencast: http://www.screencast.com/t/tVqVWA0T0p


**************************************************************************
Reopen Status:
**************************************************************************
I have checked this issue with latest master we have MonoFramework-MDK-4.3.0.1564.macos10.xamarin.x86_0421c0cff36b33a58c16930d61227b74633c1e99  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.

Thanks!!
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-4.3.0.1564.macos10.xamarin.x86_0421c0cff36b33a58c16930d61227b74633c1e99. 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-4.3.0.1919.macos10.xamarin.x86_31a147d5adc57594b2e8f8449cdf240687919275 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-4.2.1.100.macos10.xamarin.x86_ce72e1ff2487b9e72f637644fa06682f2ad0010c

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