I created a delegate and two matching methods.
private delegate bool CharComparer(char a, char b);
When I try to assign one of these methods to a delegate using the following syntax (note that this code is in a static method of the same class):
CharComparer isEqual = (ignoreCase) ? CharCompareIgnoreCase : CharCompare;
I get an error message:
The type of conditional expression cannot be determined because there is no implicit conversion between the "method group" and the "method group"
I can use the usual if ... else to complete this task, and it works fine. But I do not understand why I cannot use the more compact version, and I do not understand the error message. Does anyone know the meaning of this error?
source share