Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@novell.com>2006-10-09 20:25:27 +0400
committerMartin Baulig <martin@novell.com>2006-10-09 20:25:27 +0400
commit004ad20fcb250f3fab39ea7b92fb1acebcf3f5d9 (patch)
tree31c9b440a190ebb68f91cf1f8c374d784663a4b4 /mcs/tests/gtest-294.cs
parent378028b0ca1d98aef23db73d7ba736f27743b22e (diff)
2006-10-09 Martin Baulig <martin@ximian.com>
* generic.cs (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs. svn path=/trunk/mcs/; revision=66468
Diffstat (limited to 'mcs/tests/gtest-294.cs')
-rwxr-xr-xmcs/tests/gtest-294.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/mcs/tests/gtest-294.cs b/mcs/tests/gtest-294.cs
new file mode 100755
index 00000000000..d66c6e2f3b5
--- /dev/null
+++ b/mcs/tests/gtest-294.cs
@@ -0,0 +1,31 @@
+class A {}
+class B : A {}
+
+class X
+{
+ public static A Test (A a, B b)
+ {
+ return b ?? a;
+ }
+
+ static int Main ()
+ {
+ A a = new A ();
+ B b = new B ();
+
+ if (Test (a, b) != b)
+ return 1;
+
+ if (Test (null, b) != b)
+ return 2;
+
+ if (Test (a, null) != a)
+ return 3;
+
+ if (Test (null, null) != null)
+ return 4;
+
+ return 0;
+
+ }
+}