← Back to index
|
Original Bugzilla link
Bug 18663 – std.random.isSeedable has false positives
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-03-26T15:42:26Z
Last change time
2018-03-27T20:50:24Z
Assigned to
No Owner
Creator
Nathan S.
Comments
Comment #0
by n8sh.secondary — 2018-03-26T15:42:26Z
Example of wrong behavior: ```d int main() { import std.random : isSeedable, isUniformRNG; struct Rnd { @property uint front() {return 0;} @property bool empty() {return false;} void popFront() {} void seed(uint val){} enum isUniformRandom = true; } static assert(isUniformRNG!Rnd); static assert(isSeedable!(Rnd, ulong)); // Passes erroneously. Rnd rnd; rnd.seed(ulong.max); // Compile-time failure because seed isn't callable with ulong. return rnd.front; } ```
Comment #1
by n8sh.secondary — 2018-03-26T15:48:40Z
Pull request:
https://github.com/dlang/phobos/pull/6348
Comment #2
by github-bugzilla — 2018-03-27T20:50:23Z
Commits pushed to master at
https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/e9f56ba3b293670b7b7173ae75bf465448fff7ac
Fix Issue 18663 - std.random.isSeedable has false positives
https://github.com/dlang/phobos/commit/6400ada30fc296daef439535aea5b5b0ede6a3a0
Merge pull request #6348 from n8sh/isSeedable-fix Fix Issue 18663 - std.random.isSeedable has false positives merged-on-behalf-of: Jack Stouffer <
[email protected]
>