2007-12-06 Jb Evain <jbevain@novell.com>
[mono.git] / mono / tests / test-dup-mp.cs
blob2a0ffeb6ca8ddbe1915a6b9835a9a142a9a07811
1 /* This class works fine */
2 public class Works {
4 private double val;
6 public double this[int i, int j] {
8 get { return val; }
10 set { val = value; }
14 public Works(double val)
15 { this.val = val; }
19 /* Same code as struct breaks */
21 public struct Breaks {
23 private double val;
25 public double this[int i, int j] {
27 get { return val; }
29 set { val = value; }
33 public Breaks(double val)
34 { this.val = val; }
38 public class Tester {
40 public static void Main(string[] args)
44 System.Console.WriteLine("This works");
46 Works w = new Works(3.0);
48 w[0, 0] += 3.0;
50 System.Console.WriteLine("This breaks");
52 Breaks b = new Breaks(3.0);
54 b[0, 0] += 3.0;