[phobos] [D-Programming-Language/phobos] 853685: Fix issue 10874.

GitHub noreply at github.com
Sat Aug 24 02:33:38 PDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 8536853fc86632883d6ad18096b4980bacbb5056
      https://github.com/D-Programming-Language/phobos/commit/8536853fc86632883d6ad18096b4980bacbb5056
  Author: H. S. Teoh <hsteoh at quickfur.ath.cx>
  Date:   2013-08-22 (Thu, 22 Aug 2013)

  Changed paths:
    M std/conv.d

  Log Message:
  -----------
  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.


  Commit: a184d6b484c3f2968c379f48c6fff42828b98375
      https://github.com/D-Programming-Language/phobos/commit/a184d6b484c3f2968c379f48c6fff42828b98375
  Author: monarch dodra <monarchdodra at gmail.com>
  Date:   2013-08-24 (Sat, 24 Aug 2013)

  Changed paths:
    M std/conv.d

  Log Message:
  -----------
  Merge pull request #1505 from quickfur/issue10874

Issue 10874 - conv.to ulong to int enum conversion


Compare: https://github.com/D-Programming-Language/phobos/compare/cbc684a001e5...a184d6b484c3


More information about the phobos mailing list