[Issue 10168] Named tuple: inconsistent behavior

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 26 05:30:09 PDT 2013


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2013-05-26 05:30:08 PDT ---
Also this similar program gives an unusual error message:


import std.stdio: writeln;
import std.typecons: Tuple;
struct Foo {
    int x;
    Tuple!(Foo, "x") toTuple() {
        return Tuple!(Foo, "x")(this);
    }
}
void main() {
    auto y = Foo(100).toTuple;
    y[1].writeln; // line 11
    y.x.writeln;
}


temp.d(11): Error: no [] operator overload for type Tuple!(Foo, "x")

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