www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9888] New: std.random.uniform!enum(generator) fails

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

           Summary: std.random.uniform!enum(generator) fails
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com


--- Comment #0 from Nils <nilsbossung googlemail.com> 2013-04-05 17:06:53 PDT
---
---
cat > test.d <<code
import std.random;
enum E {a}
void main()
{
    auto r = Random(0);
    assert(r.uniform!E() == E.a);
}
code
dmd test.d
./test
---
core.exception.AssertError test(6): Assertion failure
---
(backtrace omitted)

Pull request is on the way.

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


Nils <nilsbossung googlemail.com> changed:

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


--- Comment #1 from Nils <nilsbossung googlemail.com> 2013-04-05 17:12:08 PDT
---
https://github.com/D-Programming-Language/phobos/pull/1247

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



--- Comment #2 from github-bugzilla puremagic.com 2013-04-13 06:53:55 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0cf38786a7512565be6521f4bcb7eda1100e91de
Merge pull request #1247 from NilsBossung/uniform_enum

fix Issue 9888 - std.random.uniform!enum(generator) fails

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


Andrej Mitrovic <andrej.mitrovich gmail.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: -------
Apr 13 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9888


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|std.random.uniform!enum(gen |Allow passing a generator
                   |erator) fails               |to std.random.uniform for
                   |                            |enums
           Severity|normal                      |enhancement


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