Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-713.cs
1 using System;
2
3 class DispBar : IDisposable
4 {
5
6         public void Dispose ()
7         {
8                 Console.WriteLine ("DispBar.Dispose");
9         }
10 }
11
12 class Foo
13 {
14
15         public IDisposable GetBar ()
16         {
17                 return new DispBar ();
18         }
19 }
20
21 class Test
22 {
23
24         static Foo foo = new Foo ();
25
26         public static bool TryThing ()
27         {
28                 using (IDisposable disp = foo.GetBar ()) {
29
30                         bool bang = false;
31                         foo = null;
32                         return bang;
33                 }
34         }
35
36         public static void Main ()
37         {
38                 TryThing ();
39         }
40 }