Bug 9648 – Missing std.random import for std.algorithm.topN
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-03-04T18:43:00Z
Last change time
2013-03-05T06:32:49Z
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-03-04T18:43:20Z
import std.algorithm: topN;
void main() {
auto a = [1, 2];
topN(a, 1);
}
DMD 2.063alpha gives me:
C:\dmd2\src\phobos\std\algorithm.d(7939): Error: undefined identifier uniform
C:\dmd2\src\phobos\std\algorithm.d(7959): Warning: statement is not reachable
temp.d(4): Error: template instance std.algorithm.topN!("a < b", cast(SwapStrategy)0, int[]) error instantiating
Comment #1 by andrej.mitrovich — 2013-03-04T18:48:55Z
Yeah it's only imported when -unittest is on, and since Phobos is never tested without -unittest you end up with this situation.
Comment #2 by bearophile_hugs — 2013-03-04T19:29:31Z
(In reply to comment #1)
> Yeah it's only imported when -unittest is on, and since Phobos is never tested
> without -unittest you end up with this situation.
That's a curious bug.
I have removed the ending question mark from this issue title.
Comment #3 by github-bugzilla — 2013-03-05T06:32:32Z