[Issue 6342] New: Tuple field access problem in pure function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 18 01:50:26 PDT 2011


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

           Summary: Tuple field access problem in pure function
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-07-18 01:45:10 PDT ---
DMD 2.054:


import std.typecons;
Tuple!(int, "x") foo() pure {
    int y1 = foo().x;
    int y2 = foo()[0];
    return typeof(return)(0);
}
void main() {}


test.d(3): Error: pure nested function 'foo' cannot access mutable data
'_field_field_0'
test.d(4): Error: no [] operator overload for type Tuple!(int,"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