ea5caba957
Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
46 lines
676 B
C#
46 lines
676 B
C#
using System;
|
|
|
|
namespace BrokenOverrideProperty
|
|
{
|
|
abstract class BaseClass
|
|
{
|
|
protected BaseClass (string text)
|
|
{
|
|
Whatever = text;
|
|
}
|
|
|
|
public virtual string Whatever { get; set; }
|
|
}
|
|
|
|
class DerivedClass : BaseClass
|
|
{
|
|
public string CalledValue;
|
|
|
|
public DerivedClass (string text) : base (text)
|
|
{
|
|
}
|
|
|
|
public override string Whatever {
|
|
get {
|
|
return "DerivedClass";
|
|
}
|
|
set {
|
|
CalledValue = value;
|
|
Console.WriteLine ("set called with {0}", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
class MainClass
|
|
{
|
|
public static int Main ()
|
|
{
|
|
var klass = new DerivedClass ("test-value");
|
|
if (klass.CalledValue != "test-value")
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|