www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10118] New: BigInt as associative array key wrong behavior

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

           Summary: BigInt as associative array key wrong behavior
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: alvaro.segura gmail.com


--- Comment #0 from Alvaro <alvaro.segura gmail.com> 2013-05-19 09:05:16 PDT ---
Associative arrays with BigInts as keys are unusable:

import std.bigint, std.stdio;
void main()
{
    int[BigInt] a;
    a[BigInt(3)] = 3;
    a[BigInt(3)] = 4;
    writeln(a);
}

Prints:

[3:3, 3:4]

Apparently duplicate keys.

Probably related to Issue 8435.

I thought this was a consequence of Issue 3789 because BigInt is a struct
containing a string. But that was resolved recently, and this bug still appears
in 2.063 beta.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10118



--- Comment #1 from hsteoh quickfur.ath.cx 2013-07-07 18:11:20 PDT ---
Seems to be a duplicate of #8435.

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



--- Comment #2 from hsteoh quickfur.ath.cx 2013-07-07 18:12:43 PDT ---
Bug #8435, that is.

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



--- Comment #3 from hsteoh quickfur.ath.cx 2013-07-08 07:55:51 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1402

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


Kenji Hara <k.hara.pg gmail.com> changed:

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


--- Comment #4 from Kenji Hara <k.hara.pg gmail.com> 2013-07-08 19:45:18 PDT ---
*** This issue has been marked as a duplicate of issue 8435 ***

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



--- Comment #5 from github-bugzilla puremagic.com 2013-07-22 17:44:33 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/70d4c03fe295dfdd320488b3e5435ede3b55640b
Fix issues 8435, 10118.

https://github.com/D-Programming-Language/phobos/commit/fc12f98267b6506117d88a79fd51945d2db4c6b8
Merge pull request #1402 from quickfur/bigint_hash

Fix issues 8435, 10118.

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


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |


--- Comment #6 from hsteoh quickfur.ath.cx 2013-07-22 18:51:06 PDT ---
Issue #8435 has been fixed in git HEAD, but apparently the code in this bug is
still failing, so reopening.

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



--- Comment #7 from hsteoh quickfur.ath.cx 2013-07-22 19:00:45 PDT ---
Apparently, DMD commit acd073afcb89d639c8c99cd7f8233788db6036d6 broke the fix
for this bug.

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



--- Comment #8 from Kenji Hara <k.hara.pg gmail.com> 2013-07-23 00:01:28 PDT ---
(In reply to comment #7)
 Apparently, DMD commit acd073afcb89d639c8c99cd7f8233788db6036d6 broke the fix
 for this bug.
I opened additional compiler change to fix BigInt issue: https://github.com/D-Programming-Language/dmd/pull/2374 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 23 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10118


hsteoh quickfur.ath.cx changed:

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


--- Comment #9 from hsteoh quickfur.ath.cx 2013-07-25 09:31:17 PDT ---
Verified fixed in dmd git HEAD. Thanks for the fast response, Kenji!!

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