July 13, 2022 [Issue 23242] New: InputRangeObject derived from RandomAccessInfinite is not a random-access range | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23242 Issue ID: 23242 Summary: InputRangeObject derived from RandomAccessInfinite is not a random-access range Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: snarwin+bugzilla@gmail.com As of DMD 2.100.0, the following program fails to compile: --- import std.range; void main() { auto r = repeat(0).inputRangeObject; static assert(is(typeof(r) : RandomAccessInfinite!int)); // ok static assert(isRandomAccessRange!(typeof(r))); // fails } --- This happens because the InputRangeObject r does not have an .empty property that evaluates to false at compile time, as required by std.range.primitives.isInfinite. See also issue 22608. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply