Why does a delegate with no parameters compile?
- by Ryan
I'm confused why this compiles:
private delegate int MyDelegate(int p1, int p2);
private void testDelegate()
{
MyDelegate imp = delegate
{
return 1;
};
}
MyDelegate should be a pointer to a method that takes two int parameters and returns another int, right? Why am I allowed to assign a…