[Issue 24342] T[][].until(T[]) breaks if sentinel is longer than 1.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 28 01:26:52 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24342
--- Comment #3 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8905 "merge stable" was merged into master:
- 5976fe8c1ac4aeca87642683494b50eed5f3b2c9 by Mathis Beer:
Fix Bugzilla issue 24342: Actually check that range and sentinel types match
in `until` before using "sentinel as subrange" mode.
`until` does special magic when `Sentinel` consists of multiple elements of
`Range`. However, because `Range` can be a range of ranges, in which case even
a `Sentinel` that is a range may still only be a single element, we must
confirm that the element type of `Sentinel` is actually the same as `Range`
before enabling this.
The `immutable ElementEncodingType` idiom is stolen from `startsWith`, which
forms the basis of `until` anyways (see `predSatisfied`).
https://github.com/dlang/phobos/pull/8905
--
More information about the Digitalmars-d-bugs
mailing list