summaryrefslogtreecommitdiff
path: root/mcs/tests/dtest-error-02.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/tests/dtest-error-02.cs')
-rw-r--r--mcs/tests/dtest-error-02.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/mcs/tests/dtest-error-02.cs b/mcs/tests/dtest-error-02.cs
index b8b4eb0dcd..58578fe3b5 100644
--- a/mcs/tests/dtest-error-02.cs
+++ b/mcs/tests/dtest-error-02.cs
@@ -8,6 +8,14 @@ class A
public void Foo ()
{
}
+
+ public int Property { get; set; }
+
+ string this [int index] {
+ get {
+ return "x";
+ }
+ }
}
public static dynamic Factory ()
@@ -30,6 +38,22 @@ public class Test
return 2;
}
+ try {
+ var x = d.Property;
+ return 3;
+ } catch (RuntimeBinderException e) {
+ if (e.Message != "`A.N.Property.get' is inaccessible due to its protection level")
+ return 4;
+ }
+
+ try {
+ var x = d [4];
+ return 5;
+ } catch (RuntimeBinderException e) {
+ if (e.Message != "`A.N.this[int]' is inaccessible due to its protection level")
+ return 6;
+ }
+
return 0;
}
}