digitalmars.D.bugs - [Issue 16303] New: covariant delegates should implicitly convert
- via Digitalmars-d-bugs (35/35) Jul 20 2016 https://issues.dlang.org/show_bug.cgi?id=16303
https://issues.dlang.org/show_bug.cgi?id=16303 Issue ID: 16303 Summary: covariant delegates should implicitly convert Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: bugzilla digitalmars.com 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); } --
Jul 20 2016