https://issues.dlang.org/show_bug.cgi?id=22608
Issue ID: 22608
Summary: RandomAccessInfinite is not a valid random-access
range
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
As of DMD 2.098.0, the following program fails to compile:
---
import std.range.primitives: isRandomAccessRange;
import std.range.interfaces: RandomAccessInfinite;
static assert(isRandomAccessRange!(RandomAccessInfinite!int));
---
The error message is:
---
bug.d(4): Error: static assert:
`isRandomAccessRange!(RandomAccessInfinite!int)` is false
---
The failure occurs because `isInfinite!(RandomAccessInfinite!int)` evaluates to
false, which happens because `RandomAccessInfinite!int.empty` cannot be
evaluated at compile time.
--