D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17196 - [Reg 2.074] isUnsigned!bool now true
Summary: [Reg 2.074] isUnsigned!bool now true
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-18 14:16 UTC by Martin Nowak
Modified: 2017-03-22 12:22 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2017-02-18 14:16:32 UTC
cat > bug.d << CODE
import std.traits : isUnsigned;

void pack(T)(in T value) if (is(T == bool))
{
}

void pack(T)(in T value) if (isUnsigned!T)
{
}

void test()
{
    pack(true);
}
CODE
dmd -c -o- bug.d
----
bug.d(13): Error: bug.pack called with argument types (bool) matches both:
bug.d(3):     bug.pack!bool.pack(const(bool) value)
and:
bug.d(7):     bug.pack!bool.pack(const(bool) value)
----

Caused by https://github.com/dlang/phobos/pull/5038, this breaks the msgpack-d-0.9.6.
Comment 1 Martin Nowak 2017-02-18 14:21:35 UTC
I'd opt for a temporary phobos fix and a dmd deprecation/transition of __traits(isUnsigned, bool).
Comment 2 Seb 2017-02-21 05:24:27 UTC
Pull for Phobos https://github.com/dlang/phobos/pull/5170
Comment 3 github-bugzilla 2017-02-21 11:02:24 UTC
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/58c91e1a2cbe0658a114bac87ebaed05fd630f88
Issue 17196 - [Reg 2.074] isUnsigned!bool now true

https://github.com/dlang/phobos/commit/166ae7dde3b0c4f38be9957943f3f63175803988
Merge pull request #5170 from wilzbach/fix-17196

Issue 17196 - [Reg 2.074] isUnsigned!bool now true
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
Comment 4 Martin Nowak 2017-02-24 17:58:12 UTC
Opened issue 17221 for the compiler change.
Comment 5 github-bugzilla 2017-02-24 18:15:56 UTC
Commits pushed to newCTFE at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/58c91e1a2cbe0658a114bac87ebaed05fd630f88
Issue 17196 - [Reg 2.074] isUnsigned!bool now true

https://github.com/dlang/phobos/commit/166ae7dde3b0c4f38be9957943f3f63175803988
Merge pull request #5170 from wilzbach/fix-17196
Comment 6 github-bugzilla 2017-03-22 12:22:14 UTC
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/58c91e1a2cbe0658a114bac87ebaed05fd630f88
Issue 17196 - [Reg 2.074] isUnsigned!bool now true

https://github.com/dlang/phobos/commit/166ae7dde3b0c4f38be9957943f3f63175803988
Merge pull request #5170 from wilzbach/fix-17196