http://d.puremagic.com/issues/show_bug.cgi?id=8751
Summary: Problem with pure inference of inner delegate Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2012-10-04 03:21:21 PDT --- alias bool delegate(in int) pure Bar; Bar foo1(immutable scope int x) pure { return y => x > y; // OK } Bar foo2(const scope int x) pure { return y => x > y; // error } Bar foo3(in int x) pure { return y => x > y; // error } void main() {} DMD 2.061alpha gives: temp.d(6): Error: cannot implicitly convert expression (__lambda4) of type bool delegate(const(int) y) nothrow @safe to bool delegate(const(int)) pure temp.d(9): Error: cannot implicitly convert expression (__lambda6) of type bool delegate(const(int) y) nothrow @safe to bool delegate(const(int)) pure The 'x' arguments are values, and they can't be modified inside foo1/foo2/foo3, so I think DMD should accept all three versions. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------