repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
bring Mono Security to monotouch
[mcs.git]
/
tests
/
test-var-05.cs
blob
8e048709cda6cb2c996a5b3641e2f59a3bb94e7e
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
}