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-07-31 18:43:17 +0400
committerMarek Safar <marek.safar@gmail.com>2014-07-31 18:43:58 +0400
commitac9e90a89d1bf959689c9439e6fbce07452691b5 (patch)
tree9b7a1fad7c64306213cb7026f5f03d7bb821ce15 /mcs/tests/test-903.cs
parentc3a3132005389691bef19504d7ee0be7d83d4cb4 (diff)
[mcs] null coallescing operator can end up working on value types
Diffstat (limited to 'mcs/tests/test-903.cs')
-rw-r--r--mcs/tests/test-903.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/mcs/tests/test-903.cs b/mcs/tests/test-903.cs
new file mode 100644
index 00000000000..44513478a80
--- /dev/null
+++ b/mcs/tests/test-903.cs
@@ -0,0 +1,22 @@
+using System;
+
+struct S
+{
+}
+
+class C
+{
+ public static implicit operator S (C c)
+ {
+ return new S ();
+ }
+}
+
+class Program
+{
+ static void Main ()
+ {
+ C c = new C ();
+ var x = c ?? new S ();
+ }
+} \ No newline at end of file