[interp] Fall back to old implementation when calling on proxy
[mono-project.git] / mcs / tests / gtest-513.cs
blobeac3920f25536c6a6ae0c1b11a3445c583589655
1 using System;
3 struct S : IDisposable
5 public static int hit;
7 void IDisposable.Dispose ()
9 hit++;
12 public void Dispose ()
14 throw new ApplicationException ();
18 class C : IDisposable
21 void IDisposable.Dispose ()
25 public void Dispose ()
27 throw new ApplicationException ();
31 class Test
33 public static int Main ()
35 using (new S? ()) {
38 if (S.hit != 0)
39 return 1;
41 using (new C ()) {
44 var s = new S ();
45 using (s) {
48 if (S.hit != 1)
49 return 2;
51 GenMethod (s);
53 if (S.hit != 2)
54 return 3;
56 Console.WriteLine ("ok");
57 return 0;
60 static void GenMethod<T> (T t) where T : IDisposable
62 using (t) {