6 public PointF (float a
, float b
)
10 Console
.WriteLine ("PointF created {0} and {1}", fa
, fb
);
17 public static implicit operator PointF (Point pt
)
19 return new PointF (pt
.ia
, pt
.ib
);
22 public Point (int a
, int b
)
24 Console
.WriteLine ("Initialized with {0} and {1}", a
, b
);
31 static bool ok
= false;
34 static bool Method (PointF f
)
36 Console
.WriteLine ("Method with PointF arg: {0} {1}", f
.fa
, f
.fb
);
37 if (f
.fa
!= 100 || f
.fb
!= 200)
42 static bool Call_constructor_and_implicit ()
45 return Method (new Point (100, 200));
49 static bool Init_with_implicit_conv ()
51 PointF p
= new Point (1, 100);
52 if (p
.fa
== 1 && p
.fb
== 100)
57 static bool Init_ValueType ()
59 Point p
= new Point (100, 200);
63 static bool InstanceAssignTest ()
66 x
.field
= new Point (100, 200);
67 if (x
.field
.fa
!= 100 || x
.field
.fb
!= 200)
75 if (!Init_with_implicit_conv ())
77 if (!Call_constructor_and_implicit ())
79 if (!Init_ValueType ())
81 if (!InstanceAssignTest ())
86 public static int Main ()
90 Console
.WriteLine ("Failed on test: " + t
);
91 Console
.WriteLine ("Succeed");