Thread overview
[Issue 6342] New: Tuple field access problem in pure function
Jun 18, 2013
irritate
July 18, 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@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
June 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6342


irritate <irritate@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |irritate@gmail.com


--- Comment #1 from irritate <irritate@gmail.com> 2013-06-18 16:07:19 PDT ---
Issue does not occur for me on head revision, DMD v2.064.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 19, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6342


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from bearophile_hugs@eml.cc 2013-06-18 17:18:18 PDT ---
(In reply to comment #1)
> Issue does not occur for me on head revision, DMD v2.064.

Good. Closed.

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