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-30 13:17:54 +0400
committerMarek Safar <marek.safar@gmail.com>2010-09-30 13:21:38 +0400
commita4e77bda2cc4cdf9242a4838f2a0ec78d56e617a (patch)
tree040920ae0d534e6f7573649ade0d088ff2fea27f /mcs/tests/gtest-358.cs
parent6bf2dfac4a9c39daa1e4c01a0925c600d95c89dc (diff)
More awkward nullable binary expressions which are not lifted even though they should be
Diffstat (limited to 'mcs/tests/gtest-358.cs')
-rw-r--r--mcs/tests/gtest-358.cs49
1 files changed, 45 insertions, 4 deletions
diff --git a/mcs/tests/gtest-358.cs b/mcs/tests/gtest-358.cs
index 854d7ca3d41..631dfb89c55 100644
--- a/mcs/tests/gtest-358.cs
+++ b/mcs/tests/gtest-358.cs
@@ -15,16 +15,57 @@ struct Foo
}
}
+struct S2
+{
+ public static bool operator == (S2 d1, S2? d2)
+ {
+ throw new ApplicationException ();
+ }
+
+ public static bool operator != (S2 d1, S2? d2)
+ {
+ throw new ApplicationException ();
+ }
+}
+
+public struct S3
+{
+ public static decimal operator != (S3 a, object b)
+ {
+ return -1;
+ }
+
+ public static decimal operator == (S3 a, object b)
+ {
+ return 1;
+ }
+}
+
+
public class Test
{
static Foo ctx;
+ static S2? s2;
+ static S3? s3;
- public static void Main ()
+ public static int Main ()
{
if (ctx == null)
- return;
+ return 1;
+
+ bool b = ctx != null;
+ if (!b)
+ return 2;
+
+ if (s2 != null)
+ return 3;
+
+ s3 = new S3 ();
+ decimal d = s3.Value == null;
+ if (d != 1)
+ return 4;
- if (ctx != null)
- return;
+ Console.WriteLine ("ok");
+ return 0;
}
}