2 // This tests only checks if we can compile the program.
4 // The trick is that we are accessing a protected property, with the way
5 // mcs deals with properties in two steps (property first, method next)
6 // this text excercises some eager optimizations in the TypeManager.FilterWithClosure.
9 // The second class excercises accessing private members from a container class
11 // The third class excercises accessing a private/protected value on an instance of
15 using System
.Collections
;
17 class ProtectedAccessToPropertyOnChild
: Hashtable
{
19 ProtectedAccessToPropertyOnChild ()
24 public static int Main ()
26 TestAccessToProtectedOnChildInstanceFromParent t
= new TestAccessToProtectedOnChildInstanceFromParent ();
37 // Again, only for compiling reasons
39 public class TestAccessToPrivateMemberInParentClass
45 public TestAccessToPrivateMemberInParentClass()
54 class CholeskyDecomposition
56 TestAccessToPrivateMemberInParentClass L
;
58 bool isPositiveDefinite
;
60 public CholeskyDecomposition(TestAccessToPrivateMemberInParentClass A
)
62 L
= new TestAccessToPrivateMemberInParentClass();
64 double[][] a
= A
.Array
;
65 double[][] l
= L
.Array
;
70 public class TestAccessToProtectedOnChildInstanceFromParent
{
82 public int TestAccessToProtected (Child c
)
91 class Child
: Parent
{
97 public TestAccessToProtectedOnChildInstanceFromParent ()
105 if (d
.TestAccessToProtected (c
) == 1)