[Issue 10874] std.conv.to should support conversion from ulong to int-based enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 24 02:33:48 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10874



--- Comment #2 from github-bugzilla at puremagic.com 2013-08-24 02:33:44 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/8536853fc86632883d6ad18096b4980bacbb5056
Fix issue 10874.

Don't assume that is(A : B) means a==b is valid, or that !is(A : B)
implies that a==b is invalid. Instead, test for a==b explicitly.

More specifically, int and ulong are ==-comparable, even though ulong is
not implicitly convertible to int. Thus, one should be able to convert
ulong to an int-based enum, but is(A : B) in the signature constraint
prohibits this. Testing for a==b explicitly, OTOH, makes this work.

https://github.com/D-Programming-Language/phobos/commit/a184d6b484c3f2968c379f48c6fff42828b98375
Merge pull request #1505 from quickfur/issue10874

Issue 10874 - conv.to ulong to int enum conversion

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


More information about the Digitalmars-d-bugs mailing list