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

           Summary: Problem with count inside out{} of class method
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-07-31 08:55:25 PDT ---
D2 code:


import core.stdc.stdio: printf;
import std.algorithm: count;
class Foo {
    void bar()
    out {
        int i = 10;
        count!((int k){ printf("%d\n", i); return 1; })([0]);
    } body {}
}
void main() {
    auto f = new Foo();
    f.bar();
}


It prints:
1244668

Instead of:
10

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

Reply via email to