diff options
author | Marek Safar <marek.safar@gmail.com> | 2015-11-26 13:37:02 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2015-11-26 13:38:38 +0300 |
commit | f958af36b00b7c1274204926c5186176baf08eec (patch) | |
tree | 5bb962af3ca7e0aa855628cbcb3f77b14a4004bd /mcs/tests/test-931.cs | |
parent | 8327116c331f6dd9591f482766da2e9e877fec11 (diff) |
[mcs] Fix null coalescing operator on cast of source expression resolved to implicit user operator conversion. Fixes #36161
Diffstat (limited to 'mcs/tests/test-931.cs')
-rw-r--r-- | mcs/tests/test-931.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mcs/tests/test-931.cs b/mcs/tests/test-931.cs new file mode 100644 index 00000000000..7a1f7be472d --- /dev/null +++ b/mcs/tests/test-931.cs @@ -0,0 +1,20 @@ +using System; + +class MainClass +{ + public static implicit operator string (MainClass src) + { + return null; + } + + public static int Main () + { + var obj = new MainClass (); + var s = "x"; + var res = (string) obj ?? s; + if (res != "x") + return 1; + + return 0; + } +} |