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-01-31 16:30:49 +0400
committerMarek Safar <marek.safar@gmail.com>2014-01-31 16:30:49 +0400
commit9ba287cc13abf34cffbec66d7e45ea88c1209440 (patch)
tree0ac9af747deb04b8874e23fac70b4fd1da7501c2 /mcs/tests/gtest-603.cs
parentdaa862f17f7930e5618d1e46e09de46f95c667d4 (diff)
[mcs] Explicit user conversion from nullable types does not have to lift the result. Fixes #17469
Diffstat (limited to 'mcs/tests/gtest-603.cs')
-rw-r--r--mcs/tests/gtest-603.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/mcs/tests/gtest-603.cs b/mcs/tests/gtest-603.cs
new file mode 100644
index 00000000000..dcaf7a25198
--- /dev/null
+++ b/mcs/tests/gtest-603.cs
@@ -0,0 +1,33 @@
+using System;
+
+public class A<T>
+{
+ T value;
+
+ public A (T value)
+ {
+ this.value = value;
+ }
+
+ public static explicit operator T (A<T> source)
+ {
+ return source.value;
+ }
+}
+
+public class Test
+{
+ public static int Main ()
+ {
+ var source = new A<int?> (3);
+ if (N ((int)source) != 3)
+ return 1;
+
+ return 0;
+ }
+
+ static int N (int value)
+ {
+ return value;
+ }
+} \ No newline at end of file