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

           Summary: Named tuple: inconsistent behavior
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: r.97...@gmail.com


--- Comment #0 from Ryuichi OHORI <r.97...@gmail.com> 2013-05-25 18:07:05 PDT 
---
The code at the bottom outputs
> S(314159265)
> S(0)
in DMD 2.062, http://dpaste.1azy.net/96d42b70
but
> S(0)
> S(314159265)
in another version, http://dpaste.1azy.net/edc065ea
I think right output is S(314159265) repeated 2 times.

-----
import std.stdio;
import std.typecons : Tuple;

struct S
{
    int x;
    Tuple!(S, "x") toTuple()
    {
        return Tuple!(S, "x")(this);
    }
}

void main()
{
    auto y = S(314159265).toTuple();
    y[0].writeln();
    y.x.writeln();
}

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

Reply via email to