Thread overview
[Issue 21062] Confusing error when using a keyword as an identifier for a declaration
[Issue 21062] Compiler produces wildly different diagnostics based on variable names
Jul 21, 2020
Andrej Mitrovic
[Issue 21062] Diagnostic for 'synchronized' used as a variable name should be improved
Jul 21, 2020
Andrej Mitrovic
[Issue 21062] Compiler produces wildly different diagnostics based on variable names
Jul 21, 2020
Basile-z
Jul 23, 2020
RazvanN
Nov 06, 2022
Dennis
Nov 06, 2022
Dlang Bot
Nov 08, 2022
Dlang Bot
July 21, 2020
https://issues.dlang.org/show_bug.cgi?id=21062

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
So apparently I forgot synchronized is a statement, but the compiler should emit a better diagnostic. I'll rename the issue.

--
July 21, 2020
https://issues.dlang.org/show_bug.cgi?id=21062

Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Compiler produces wildly    |Diagnostic for
                   |different diagnostics based |'synchronized' used as a
                   |on variable names           |variable name should be
                   |                            |improved

--
July 21, 2020
https://issues.dlang.org/show_bug.cgi?id=21062

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |b2.temp@gmx.com
            Summary|Diagnostic for              |Compiler produces wildly
                   |'synchronized' used as a    |different diagnostics based
                   |variable name should be     |on variable names
                   |improved                    |

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
yeah it's a keyword, so parser error. Maybe just

"cannot use `%s` as identifier because this is a keyword"

and as errorSupplemental()

"append a trailing underscore"

--
July 23, 2020
https://issues.dlang.org/show_bug.cgi?id=21062

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |trivial
                 CC|                            |razvan.nitu1305@gmail.com

--
November 06, 2022
https://issues.dlang.org/show_bug.cgi?id=21062

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel@live.nl
            Summary|Compiler produces wildly    |Confusing error when using
                   |different diagnostics based |a keyword as an identifier
                   |on variable names           |for a declaration

--
November 06, 2022
https://issues.dlang.org/show_bug.cgi?id=21062

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

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

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@dkorpel created dlang/dmd pull request #14627 "Fix 21062 - Confusing error when using a keyword as an identifier for…" fixing this issue:

- Fix 21062 - Confusing error when using a keyword as an identifier for a declaration

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

--
November 08, 2022
https://issues.dlang.org/show_bug.cgi?id=21062

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

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14627 "Fix 21062 - Confusing error when using a keyword as an identifier for…" was merged into master:

- d124ecbb53869d6902e5140becca920c80f9555d by Dennis Korpel:
  Fix 21062 - Confusing error when using a keyword as an identifier for a
declaration

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

--