D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4171 - std.random.uniform does not work for a range of characters
Summary: std.random.uniform does not work for a range of characters
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 10:45 UTC by Pelle Månsson
Modified: 2015-06-09 05:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Pelle Månsson 2010-05-10 10:45:34 UTC
import std.random;

void main() {
    uniform('a', 'z');
}

results in

phobos/std/random.d(659): Error: cannot implicitly convert expression (cast(int)b - 1) of type int to char
Comment 1 David Simcha 2010-06-17 18:05:51 UTC
Fixed in SVN.