Bug 9184 – std.algorithm.all fails to compile when providing a lambda

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-19T03:22:00Z
Last change time
2014-02-16T15:57:26Z
Assigned to
nobody
Creator
jens.k.mueller

Comments

Comment #0 by jens.k.mueller — 2012-12-19T03:22:50Z
test.d --- unittest { import std.algorithm; assert(all!(a => a >= 0)([1, 2, 3])); } --- $ dmd -unittest -run test.d fails with Error: function test.__unittest3.not!(__lambda2).not!(int).not is a nested function and cannot be accessed from std.algorithm.find!(not,int[]).find Changing std.algorithm.all to return find!((a) => !unaryFun!pred(a))(range).empty; works. Though I'm not sure whether this is an appropriate fix. Please advice that I can create a pull request. $ dmd | head -1 DMD64 D Compiler v2.060
Comment #1 by github-bugzilla — 2013-04-07T05:59:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c834f350d11563f95246e79bae06a582e7fc2924 Fixes Issue 9184 - Document -op better. https://github.com/D-Programming-Language/dmd/commit/e849215dc9572da80b88c322aead62b01d70e11a Merge pull request #1860 from AndrejMitrovic/Fix9185_2 [trivial] Issue 9184 - Document -op better.
Comment #2 by peter.alexander.au — 2014-02-11T11:48:08Z
Was fixed in 2.063.
Comment #3 by jens.k.mueller — 2014-02-14T00:20:44Z
Thanks. Works here (Linux dmd v2.064) as well. Don't know though which commit fixed it. It's *not* the one above.
Comment #4 by peter.alexander.au — 2014-02-16T14:29:26Z
Changed to WORKSFORME so that it doesn't appear in the changelog for next update.
Comment #5 by jens.k.mueller — 2014-02-16T15:04:46Z
Huh? Why WORKSFORME? Doesn't this imply that the issue cannot be reproduced? To me it's a bug and it got fixed.
Comment #6 by peter.alexander.au — 2014-02-16T15:09:27Z
(In reply to comment #5) > Huh? Why WORKSFORME? Doesn't this imply that the issue cannot be reproduced? To > me it's a bug and it got fixed. But it was fixed in an earlier version, so it needs to be marked as WORKSFORME otherwise it will show up in the changelogs for the next version. Mozilla even suggest this approach: "In general you can resolve a bug as WFM if: ... * the build the bug is reported against is more than one stable release old and the bug can't be reproduced with a current build." https://developer.mozilla.org/en/docs/What_to_do_and_what_not_to_do_in_Bugzilla#Resolving_bugs_as_WORKSFORME
Comment #7 by jens.k.mueller — 2014-02-16T15:57:26Z
I see. Only bugs that are closed in time are considered to be fixed (with regard to the Changelog).