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