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>2010-09-29 16:18:57 +0400
committerMarek Safar <marek.safar@gmail.com>2010-09-30 13:21:37 +0400
commit6bf2dfac4a9c39daa1e4c01a0925c600d95c89dc (patch)
tree4230902cff32ed1cec84487bf57062c648ce5c1c /mcs/tests/gtest-139.cs
parent715628fe366c3ad1249480383d75ae603b3c3531 (diff)
Implement binary user operators over nullable not lifted expressions.
Diffstat (limited to 'mcs/tests/gtest-139.cs')
-rw-r--r--mcs/tests/gtest-139.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/mcs/tests/gtest-139.cs b/mcs/tests/gtest-139.cs
new file mode 100644
index 00000000000..435598de5e1
--- /dev/null
+++ b/mcs/tests/gtest-139.cs
@@ -0,0 +1,42 @@
+using System;
+
+public struct MyStruct
+{
+ public static int operator !=(MyStruct? a, string b)
+ {
+ return -1;
+ }
+
+ public static int operator ==(MyStruct? a, string b)
+ {
+ return 1;
+ }
+
+ public static int operator !=(string a, MyStruct? b)
+ {
+ return -2;
+ }
+
+ public static int operator ==(string a, MyStruct? b)
+ {
+ return 2;
+ }
+}
+
+public class Test
+{
+ public static int Main()
+ {
+ MyStruct? ms = new MyStruct ();
+ int v;
+ v = ms == "a";
+ if (v != 1)
+ return 1;
+
+ v = "b" != ms;
+ if (v != -2)
+ return 2;
+
+ return 0;
+ }
+} \ No newline at end of file