www.digitalmars.com         C & C++   DMDScript  
Archives

D Programming
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger
D.gnu
D

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics


digitalmars.D.bugs - [Issue 3047] New: Foreach on tuple produces incorrect result

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 digitalmars.com
        ReportedBy: sean 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: -------
Jun 02 2009