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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 18 06:57:01 UTC 2024


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8894 "Fix issue 24342: Actually check that range and
sentinel types match" was merged into stable:

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

--


More information about the Digitalmars-d-bugs mailing list