[Issue 3075] void delegate(const(void)[]) should be implicitly convertable to void delegate(void[])

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 28 08:41:48 PST 2009


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



--- Comment #21 from Steven Schveighoffer <schveiguy at yahoo.com> 2009-12-28 08:41:46 PST ---
Just submitted bug 3656, which might require contravariance for delegates to
make it work properly...

Consider that a function foo:

foo(void delegate() dg)
{
   dg();
}

should compile with the following:

class A
{
   void f1() const {}
   void f2() {}
}

void main()
{
   A a = new A;
   foo(&a.f1);
   foo(&a.f2);
}

But if bug 3656 is resolved (and it must be to preserve const), then there is
no current way to mark foo as not caring whether the delegate is const or not.

-- 
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