[Issue 3047] New: Foreach on tuple produces incorrect result

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 2 08:48:55 PDT 2009


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

           Summary: Foreach on tuple produces incorrect result
           Product: D
           Version: 2.030
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: sean at invisibleduck.org


The following code:

    import std.stdio;
    import std.traits;

    void fn(T...)(T fns)
    {
        foreach(fn; fns)
        {
            writefln( "%s", ParameterTypeTuple!(fn)[0].mangleof );
        }
    }

    void main()
    {
        void a(int x) {}
        void b(double y) {}
        void c(Object z) {}

        fn(&a, &b, &c);
    }

Prints:

    i
    i
    i

When the type output should be int, double, Object, respectively.

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