[Issue 24202] New: std.range.chain ganerated object has wrong .init
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 26 16:57:26 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24202
Issue ID: 24202
Summary: std.range.chain ganerated object has wrong .init
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dragoscarp at gmail.com
https://github.com/dlang/phobos/commit/128f75181c00a805cce29ccbd2b8927105b5eb88
introduced a regression.
Test case:
struct MyRange
{
@property int front() { return opIndex; }
void popFront() { }
int opIndex() { return 42; }
@property bool empty() { return true;}
@property size_t length() { return 0 ; }
}
import std.range : chain, empty;
unittest
{
assert(chain(MyRange(), MyRange()).init.empty);
}
////////////////////////////////////
Observed result (dmd >= 1.104.0)
Assertion fails.
Expected result:
assertion passes (working with dmd 1.103.1)
--
More information about the Digitalmars-d-bugs
mailing list