projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
do not check order sequence if option /order was not used
[mono.git]
/
mcs
/
tests
/
test-var-05.cs
1
2
// Tests variable type inference with the var keyword when using the "using" statement
3
using System;
4
5
public class MyClass : IDisposable
6
{
7
private string s;
8
public MyClass (string s)
9
{
10
this.s = s;
11
}
12
public void Dispose()
13
{
14
s = "";
15
}
16
}
17
18
public class Test
19
{
20
static int Main ()
21
{
22
using (var v = new MyClass("foo"))
23
if (v.GetType() != typeof (MyClass))
24
return 1;
25
26
return 0;
27
}
28
}