Thread overview
[Issue 23355] invalid template parameter loses error location in some cases
Sep 21, 2022
mhh
Sep 21, 2022
Dlang Bot
Sep 22, 2022
Dlang Bot
September 21, 2022
https://issues.dlang.org/show_bug.cgi?id=23355

mhh <maxhaton@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxhaton@gmail.com

--- Comment #1 from mhh <maxhaton@gmail.com> ---
This happens because the compiler parses T[n] as an associative array type and types don't have locations

--
September 21, 2022
https://issues.dlang.org/show_bug.cgi?id=23355

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

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

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WebFreak001 updated dlang/dmd pull request #14465 "fix 23355: invalid template parameter loses error location in some cases (T[UndefinedIdentifier] has no error loc)" fixing this issue:

- fix 23355: T[UndefinedIdentifier] has no error loc

  Types (e.g. TypeAArray) don't have a location attached to them, so
  instead of trying to use that we instead
  use the error location from the general template parameters.

- add test for issue 23355

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

--
September 22, 2022
https://issues.dlang.org/show_bug.cgi?id=23355

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

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

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14465 "fix 23355: invalid template parameter loses error location in some cases (T[UndefinedIdentifier] has no error loc)" was merged into master:

- bbd03ee16ad8c46897ce74044148e02b562c0ee9 by WebFreak001:
  fix 23355: T[UndefinedIdentifier] has no error loc

  Types (e.g. TypeAArray) don't have a location attached to them, so
  instead of trying to use that we instead
  use the error location from the general template parameters.

  Co-authored-by: mhh <maxhaton@gmail.com>

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

--