You've already forked linux-packaging-mono
Imported Upstream version 4.2.1.36
Former-commit-id: fb75898888a02f4d3a74cf0a5b841681bc4c7fa8
This commit is contained in:
committed by
Jo Shields
parent
9668de7cb8
commit
dd547c45d4
45
mcs/tests/gtest-autoproperty-20.cs
Normal file
45
mcs/tests/gtest-autoproperty-20.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user