class Test
{
public delegate void FruitDelegate(Fruit f);
public void Notify(Action del) where T : Fruit
{
FruitDelegate f = d
There is good reason you cannot do this. Suppose the rest of your method was:
class Test
{
public delegate void FruitDelegate(Fruit f);
public void Notify(Action del) where T : Fruit
{
FruitDelegate f = del;
f(new Banana()); //should be legal, but del may be Action
}
}
That would definitely not work, so the compiler is correct here.