Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-241.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c15b0efb86e1244534f383ef7433ee9b3373e59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// 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 () { }
}