Delegate arguments should be checked for covariance when implicitly converting to a base delegate type:
--------------------------------------
void yayf(void function(int*) fp);
void yayd(void delegate(int*) dg);
void bar()
{
void function(const(int)* p) fp;
yayf(fp); // should be good but produces error
void delegate(const(int)* p) dg;
yayd(dg); // should be good but produces error
}
void nayf(void function(const(int)*) fp);
void nayd(void delegate(const(int)*) dg);
void bar()
{
void function(int* p) fp;
nayf(fp); // correctly produces error
void delegate(int* p) dg; // correctly produces error
nayd(dg);
}
Comment #1 by mathias.lang — 2016-07-20T09:15:25Z
I thought that was parameter contravariance and that could not work in the general case because of overloading ?
AFAICS, it's a duplicate of https://issues.dlang.org/show_bug.cgi?id=3075