www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4429] New: .keys for V[real] broken

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

           Summary: .keys for V[real] broken
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



This bug seems to apply no matter what V is, but only applies when the key is a
real, not a float or a double.

import std.stdio;

void main() {
    uint[real] foo;
    foo[3.14159265] = 1;
    foo[2.71828182] = 2;
    foo[6.66] = 3;

    writeln(foo);  // Works
    writeln(foo.keys);  // 6.66 -0 -0
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4429


bearophile_hugs eml.cc changed:

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



Bugs happen, it's life. But this is silly. Phobos/druntime must be designed
differently, with a more serious amount of unittests: a bug as simple as this
one must be found during development of Phobos/druntime, and not by language
users because the code is written in an amateurish way.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4429


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |DUPLICATE



04:38:40 PDT ---
I think the keys member is horribly broken if the size of the key isn't size_t.
 I'll add an appropriate comment to 4201 to indicate reals also are a problem.

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

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