Author: martin
Date: 2005-03-07 09:54:52 -0500 (Mon, 07 Mar 2005)
New Revision: 41526
Added:
trunk/mcs/tests/gen-135.cs
trunk/mcs/tests/gen-136.cs
trunk/mcs/tests/gen-137.cs
trunk/mcs/tests/gen-138.cs
trunk/mcs/tests/gen-139.cs
trunk/mcs/tests/gen-140.cs
Modified:
trunk/mcs/tests/ChangeLog
Log:
2005-03-07 Martin Baulig <[EMAIL PROTECTED]>
* gen-134.cs, gen-135.cs, gen-136.cs, gen-137.cs, gen-138.cs,
gen-139.cs, gen-140.cs: These were my very first test cases for
Nullable Types.
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/ChangeLog 2005-03-07 14:54:52 UTC (rev 41526)
@@ -1,5 +1,11 @@
2005-03-07 Martin Baulig <[EMAIL PROTECTED]>
+ * gen-134.cs, gen-135.cs, gen-136.cs, gen-137.cs, gen-138.cs,
+ gen-139.cs, gen-140.cs: These were my very first test cases for
+ Nullable Types.
+
+2005-03-07 Martin Baulig <[EMAIL PROTECTED]>
+
* gen-130.cs, gen-131.cs, gen-132.cs, gen-133.cs, gen-134.cs: New
test cases for Nullable Types. Thanks a lot to Peter Sestoft :-)
Added: trunk/mcs/tests/gen-135.cs
===================================================================
--- trunk/mcs/tests/gen-135.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-135.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,14 @@
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = null;
+ int b = 3;
+ long? c = a;
+ Console.WriteLine (c);
+ long? d = b;
+ byte? f = (byte?) d;
+ }
+}
Added: trunk/mcs/tests/gen-136.cs
===================================================================
--- trunk/mcs/tests/gen-136.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-136.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,44 @@
+using System;
+
+namespace Martin {
+ public class A
+ {
+ public readonly long Data;
+
+ public A (long data)
+ {
+ this.Data = data;
+ }
+
+ public static explicit operator B (A a)
+ {
+ return new B ((int) a.Data);
+ }
+ }
+
+ public class B
+ {
+ public readonly int Data;
+
+ public B (int data)
+ {
+ this.Data = data;
+ }
+
+ public static implicit operator A (B b)
+ {
+ return new A (b.Data);
+ }
+ }
+
+ class X
+ {
+ static void Main ()
+ {
+ B? b = new B (5);
+ A? a = b;
+ B? c = (B?) a;
+ B? d = (Martin.B?) a;
+ }
+ }
+}
Added: trunk/mcs/tests/gen-137.cs
===================================================================
--- trunk/mcs/tests/gen-137.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-137.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,11 @@
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = 4;
+ int? b = -a;
+ Console.WriteLine (b);
+ }
+}
Added: trunk/mcs/tests/gen-138.cs
===================================================================
--- trunk/mcs/tests/gen-138.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-138.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,12 @@
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = 4;
+ long b = 5;
+ long? c = a * b;
+ Console.WriteLine (c);
+ }
+}
Added: trunk/mcs/tests/gen-139.cs
===================================================================
--- trunk/mcs/tests/gen-139.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-139.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,11 @@
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ bool? a = true;
+ int? b = a ? 3 : 4;
+ Console.WriteLine (b);
+ }
+}
Added: trunk/mcs/tests/gen-140.cs
===================================================================
--- trunk/mcs/tests/gen-140.cs 2005-03-07 14:48:26 UTC (rev 41525)
+++ trunk/mcs/tests/gen-140.cs 2005-03-07 14:54:52 UTC (rev 41526)
@@ -0,0 +1,11 @@
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int?[] bvals = new int?[] { null, 3, 4 };
+ foreach (long? x in bvals)
+ Console.WriteLine (x);
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches