Thread overview
[Issue 10680] New: BigInt uses deprecated std.traits.unsigned
Jul 20, 2013
Jonathan M Davis
Jul 20, 2013
Jonathan M Davis
Jul 21, 2013
Jonathan M Davis
July 20, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10680

           Summary: BigInt uses deprecated std.traits.unsigned
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2013-07-20 07:58:34 PDT ---
I think unsigned() is a trait, so it should be in std.traits. But in the meantime there is this small problem:


import std.bigint: BigInt;
void main() {
    BigInt(1);
}



DMD 2.064alpha gives:

...\dmd2\src\phobos\std\bigint.d(534): Deprecation: alias std.traits.unsigned is deprecated - unsigned has been moved to std.conv. Please adjust your imports accordingly.

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


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg@gmx.com> 2013-07-20 11:58:03 PDT ---
Traits are eponymous templates which tell you a trait of a type or symbol - i.e. give you some kind of information about it. unsigned does nothing of the sort. It's a function which casts to the unsigned version of an integral type. It's a conversion function and as such makes perfect sense in std.conv. It was discussed when the pull for that was made, and the decision was made to move it into std.conv, because it fits better there.

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


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #2 from Jonathan M Davis <jmdavisProg@gmx.com> 2013-07-20 11:58:29 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1427

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



--- Comment #3 from bearophile_hugs@eml.cc 2013-07-20 12:15:37 PDT ---
(In reply to comment #1)
> Traits are eponymous templates which tell you a trait of a type or symbol - i.e. give you some kind of information about it. unsigned does nothing of the sort. It's a function which casts to the unsigned version of an integral type. It's a conversion function and as such makes perfect sense in std.conv. It was discussed when the pull for that was made, and the decision was made to move it into std.conv, because it fits better there.

Right, thank you.

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



--- Comment #4 from github-bugzilla@puremagic.com 2013-07-21 05:40:12 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/668087adb71c51637371967ee43a066cfdfafc83 Fix for issue# 10680.

unsigned was moved to std.conv (with a deprecated alias left in std.traits), but std.bigint was not updated accordingly. This fixes that.

https://github.com/D-Programming-Language/phobos/commit/4e9063b9599f206667224f6baf705b0644bb1701 Merge pull request #1427 from jmdavis/10680

Fix for issue# 10680.

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


Jonathan M Davis <jmdavisProg@gmx.com> changed:

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


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