Created
March 9, 2016 23:01
-
-
Save svick/a1e8c0aeedf6e31aa956 to your computer and use it in GitHub Desktop.
Why roslyn#9606 would be ambiguous
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var a = new C(); | |
| // var x = a? +a? +a : a; | |
| var x = (a != null) +a? +a : a; | |
| var y = a? (+a != null) +a : a; | |
| } | |
| class C | |
| { | |
| public static C operator+(C c) | |
| { | |
| return c; | |
| } | |
| public static C operator+(C c1, C c2) | |
| { | |
| return c1; | |
| } | |
| public static C operator+(bool b, C c2) | |
| { | |
| return c2; | |
| } | |
| public static implicit operator bool(C c) | |
| { | |
| return true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment