.NET Fiddle

CSharp · Console

/Program.cs

using System;

public class Program
{
	public static void Main()
	{
		Foo foo = new Foo();
		
		if(foo && foo){ // Compiled to foo.false() ? foo : Foo.&(foo, foo)
			Console.WriteLine("If");
		}
	}
}

class Foo {
	public static bool operator true(Foo t) { 
		Console.WriteLine("True");
		return true; 
	}
	
	public static bool operator false(Foo t) {
		Console.WriteLine("False");
		return true; 
	}
	
	public static Foo operator &(Foo lhs, Foo rhs)
	{
		Console.WriteLine("&");
       	return new Foo();
	}
}
;