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

           Summary: Problem with TypeTuple of lambdas
           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-03-04 05:11:10 PST ---
I don't understand what's happening here, but there is a problem somewhere
(maybe in this code), D2 code:


import std.stdio, std.typetuple;

alias TypeTuple!((double x){ return x + x; },
                 (double x){ return x * x; }) funcs1;

double foo1(double x) { return x + x; }
double foo2(double x) { return x * x; }
alias TypeTuple!(foo1, foo2) funcs2;

void main() {
    enum double x = 5.0;

    foreach (f; funcs1)
        writeln(f(x));

    foreach (f; funcs2)
        writeln(f(x));
}


It prints (DMD 2.052):
5.28268e-308
0
10
25

Instead of:
10
25
10
25

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

Reply via email to