[Issue 24342] T[][].until(T[]) breaks if sentinel is longer than 1.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 17 13:42:06 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24342

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot at dlang.rocks> ---
@FeepingCreature updated dlang/phobos pull request #8894 "Fix issue 24342:
Actually check that range and sentinel types match" fixing this issue:

- 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/8894

--


More information about the Digitalmars-d-bugs mailing list