C: > I want to fill a ubyte array with random data.
In D ubytes are not char, they are two different types. So if you want ubytes, then use ubytes: uniform!("[]")(ubyte.min, ubyte.max) Regarding your error, a reduced test case: import std.random: uniform; void main() { uniform!("[]")(char.min, char.max); uniform!("(]")(char.min, char.max); } Bye, bearophile