www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5951] New: writeln(AAbyValue()) doesn't show the values

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5951

           Summary: writeln(AAbyValue()) doesn't show the values
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



import std.stdio;
void main() {
    int[int] hash = [1:2, 3:4];
    auto vals = hash.byValue();
    writeln(vals);
}


With DMD 2.053beta at runtime the writeln prints:
int delegate(int delegate(ref int))

Expected: the sequence of the items, something like:
[2; 4]


See also bug 3813

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 07 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5951


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |kennytm gmail.com
         Resolution|                            |DUPLICATE



Please make this request WONTFIX. AA.byValue simply returns a delegate as shown
in the report. writeln doesn't know if the delegate is from byValue, or just a
normal delegate, not intended for iteration. 

The correct solution is to make byValue a forward range. 

And please stop filing the same bug again and again :). You have already filed


*** This issue has been marked as a duplicate of issue 4704 ***

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