[build] Fix warning (#4177)
[mono-project.git] / mcs / tests / test-var-05.cs
blob7a68b10fa1792c94c273884d9fc45fcc821d4980
2 // Tests variable type inference with the var keyword when using the "using" statement
3 using System;
5 public class MyClass : IDisposable
7 private string s;
8 public MyClass (string s)
10 this.s = s;
12 public void Dispose()
14 s = "";
18 public class Test
20 public static int Main ()
22 using (var v = new MyClass("foo"))
23 if (v.GetType() != typeof (MyClass))
24 return 1;
26 return 0;