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
2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git]
/
tests
/
gtest-var-06.cs
blob
7e6ba29d3803e7ac3d641a42daf4d9d072c7c84c
1
// Compiler options: -langversion:linq -unsafe
2
// Tests variable type inference with the var keyword when using the "fixed" statement
3
using
System
;
4
5
public class
Point
6
{
7
public int
X
;
8
public int
Y
;
9
}
10
11
public class
Test
12
{
13
unsafe static int
Main
()
14
{
15
Point p
=
new
Point
();
16
p
.
X
=
42
;
17
p
.
Y
=
16
;
18
19
fixed
(
var
x
= &
p
.
X
)
20
if
(*
x
!=
42
)
21
return
1
;
22
23
return
0
;
24
}
25
}