[Issue 8751] Problem with pure inference of inner delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 9 10:28:39 PDT 2012


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



--- Comment #6 from bearophile_hugs at eml.cc 2012-10-09 10:04:36 PDT ---
This code, that is derived more closely from my use case, gives an error, after
merging the patch:


alias bool delegate(in int) pure Dg;
Dg foo1(immutable Dg f) pure {
    return x => f(x); // OK
}
Dg foo2(const Dg f) pure {
    return x => f(x); // error
}
void main() {}


DMD patched gives:

temp.d(6): Error: cannot implicitly convert expression (__lambda4) of type bool
delegate(const(int) x) @system to bool delegate(const(int)) pure

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