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>2016-11-17 20:40:45 +0300
committerMarek Safar <marek.safar@gmail.com>2016-11-17 20:47:46 +0300
commit2184c18487d1e62b0988361bd4a807c8fedc394c (patch)
treec9d24c73a1b976adae35b8182d57d4da19cc22b5 /mcs/tests/gtest-640.cs
parentb17e4c71eca86c911e721a08500b95d1cd1693de (diff)
[mcs] Fixes user operator extraction from shared list. Fixes #46806
Diffstat (limited to 'mcs/tests/gtest-640.cs')
-rw-r--r--mcs/tests/gtest-640.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/mcs/tests/gtest-640.cs b/mcs/tests/gtest-640.cs
new file mode 100644
index 00000000000..2aeebb4e54e
--- /dev/null
+++ b/mcs/tests/gtest-640.cs
@@ -0,0 +1,39 @@
+using System;
+
+public struct Test
+{
+ public static Test op_Addition<T>(Test p1, T p2)
+ {
+ throw new ApplicationException ();
+ }
+
+ public static int op_Addition<T>(T p1, int p2)
+ {
+ throw new ApplicationException ();
+ }
+
+ public static Test operator +(Test p1, Test p2)
+ {
+ throw new ApplicationException ();
+ }
+
+ public static long operator +(Test p1, int p2)
+ {
+ return 4;
+ }
+}
+
+public class Program
+{
+ public static int Main ()
+ {
+ var t = new Test ();
+
+ int p2 = 20;
+ var res = t + p2;
+ if (res != 4)
+ return 1;
+
+ return 0;
+ }
+} \ No newline at end of file