public void CompatibilityOfDelegateInstances() { ADelegateWithAnInt a = WriteToDebug; ADelegateWithAnInt b = WriteToDebug; ADelegateWithAnInt c = WriteToDebugWithMessage; var isInstanceAEqualToB = a == b; var isInstanceAEqualToC = a == c; }
public void CompatibilityOfDelegateTypes() { //ADelegateWithAnInt a = new ADelegateWithAnInt(WriteToDebug); ADelegateWithAnInt a = WriteToDebug; AnotherDelegateWithAnInt b; // This will not compile // b = a; // nor this // b = (AnotherDelegateWithAnInt) a; }