Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

33 lines
528 B
C#

//
// This test is for bug 57303
//
// Access via a base-instance to a protected method is allowed if we are a nested class
//
using System;
public class Foo {
protected virtual int SomeProperty {
get { return 10; }
}
protected virtual int M ()
{
return 10;
}
private class FooPrivate : Foo {
Foo _realFoo;
internal FooPrivate(Foo f) {
_realFoo = f;
}
protected override int SomeProperty {
get { return this._realFoo.SomeProperty + _realFoo.M ();
}
}
}
public static void Main () { }
}