Cannot assign a delegate of one type to another even though signature matches
问题 My morbid curiosity has me wondering why the following fails: // declared somewhere public delegate int BinaryOperation(int a, int b); // ... in a method body Func<int, int, int> addThem = (x, y) => x + y; BinaryOperation b1 = addThem; // doesn't compile, and casting doesn't compile BinaryOperation b2 = (x, y) => x + y; // compiles! 回答1: C# has very limited support for "structural" typing. In particular, you can't cast from one delegate-type to another simply because their declarations are