Thread overview
[Issue 23565] Change `$` semantics so that it works with `.ptr` too
Dec 17, 2022
Iain Buclaw
Dec 19, 2022
Dlang Bot
Dec 20, 2022
Basile-z
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23565

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 19, 2022
https://issues.dlang.org/show_bug.cgi?id=23565

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

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

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@SixthDot created dlang/dmd pull request #14716 "fix issue 23565 - Allow the use of `$` as index on `.ptr` expressions" fixing this issue:

- fix issue 23565 - Allow the use of `$` as index on `.ptr` expressions

  We can use `.ptr` in slice and indexes expressions to bypass bounds
verification
  but then we loose the opportunity to use `$` in the expression that give the
subscripts,
  even if an array and hence a `.length` is possible.

  This commit fix the problem as long as the `.ptr` LHS is a (optionally
dotted) variable

  The implementation is based on a front-end lowering as the existing
  system was not designed for this case (it finalize the substitution in
  the mid-end function `resolveLengthVar()`)

https://github.com/dlang/dmd/pull/14716

--
December 20, 2022
https://issues.dlang.org/show_bug.cgi?id=23565

Basile-z <b2.temp@gmx.com> changed:

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

--