[Issue 3180] Need delegate covariance and contravariance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 15 18:13:11 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3180


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com
           Severity|normal                      |enhancement




--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com>  2009-07-15 18:13:10 PDT ---
Your contravariance example is not valid, you cannot call foo(B) with an A.

It should be:

class V
{
  void foo(A);
}


...

V v = new v;
void delegate(B) g = &v.foo; // contravariance

Also this is somewhat of a duplicate of bug 3075.  Although you do bring up
covariance for delegates, which should be implemented at the same time as
contravariance.

Sadly, Walter has decided the prior bug is an invalid enhancement request, so
most likely nothing will come of this request either.

I think the only possible way this may be included is if someone implements it
and submits it as a patch to dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list