Area-CompilersBugConcept-Diagnostic Clarityhelp wanted
Repository metrics
- Stars
- (20,414 stars)
- PR merge metrics
- (Avg merge 6d 17h) (256 merged PRs in 30d)
Description
Why does the following code given an error during compilation? public class A { }
public class B
{
private static A AF { get; }
public B()
{
AF = new A();
}
}
C# 6.0, .NET 4.5, VS2015 Update 3
Expected Behavior: This code should not give a compiler error
Actual Behavior: error CS0200: Property or indexer 'B.AF' cannot be assigned to -- it is read only