[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / dtest-error-02.cs
blob58578fe3b50ab5351a159c1babe4262593ee6f06
1 using System;
2 using Microsoft.CSharp.RuntimeBinder;
4 class A
6 private class N
8 public void Foo ()
12 public int Property { get; set; }
14 string this [int index] {
15 get {
16 return "x";
21 public static dynamic Factory ()
23 return new N ();
27 public class Test
29 public static int Main ()
31 dynamic d = A.Factory ();
33 try {
34 d.Foo ();
35 return 1;
36 } catch (RuntimeBinderException e) {
37 if (e.Message != "`A.N.Foo()' is inaccessible due to its protection level")
38 return 2;
41 try {
42 var x = d.Property;
43 return 3;
44 } catch (RuntimeBinderException e) {
45 if (e.Message != "`A.N.Property.get' is inaccessible due to its protection level")
46 return 4;
49 try {
50 var x = d [4];
51 return 5;
52 } catch (RuntimeBinderException e) {
53 if (e.Message != "`A.N.this[int]' is inaccessible due to its protection level")
54 return 6;
57 return 0;