fork download
  1. using System;
  2.  
  3. public class A { }
  4.  
  5. public class B {
  6. public static implicit operator B(A a) {
  7. return new B();
  8. }
  9. }
  10.  
  11. public static class Program {
  12. public static void Main() {
  13. var x = true ? new A() : new B();
  14. Console.WriteLine(x.GetType());
  15. }
  16. }
  17.  
Success #stdin #stdout 0.02s 33840KB
stdin
Standard input is empty
stdout
B