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:
authorMarek Safar <marek.safar@gmail.com>2014-08-14 13:49:46 +0400
committerMarek Safar <marek.safar@gmail.com>2014-08-14 13:50:54 +0400
commit62a15c8e13cccbc1fc51420da2ec1717568c1e7f (patch)
treebd14da8e6fc07b1621e75586e54e187b0e1bffba /mcs/tests/gtest-621.cs
parent512c1407b3f86b18df140768e6476bae2057be54 (diff)
[mcs] coalescing operator if the lhs of a null is a integer type that is larger than the integer type on the rhs. Fixes #22054
Diffstat (limited to 'mcs/tests/gtest-621.cs')
-rw-r--r--mcs/tests/gtest-621.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/mcs/tests/gtest-621.cs b/mcs/tests/gtest-621.cs
new file mode 100644
index 00000000000..cfff301328e
--- /dev/null
+++ b/mcs/tests/gtest-621.cs
@@ -0,0 +1,29 @@
+using System;
+
+class X
+{
+ static int Main ()
+ {
+ int? intArg = 1;
+ long? longArg = 2;
+
+ var g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != 1)
+ return 1;
+
+ intArg = null;
+ g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != 2)
+ return 2;
+
+ longArg = null;
+ g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != null)
+ return 3;
+
+ return 0;
+ }
+} \ No newline at end of file