Thread overview
[Issue 20730] [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation
[Issue 20730] [REG 2.091] Template instantiation errors after any real errors
Apr 12, 2020
JR
[Issue 20730] [REG 2.091] Gagged __traits(compiles) fails if any ungagged errors happened
Apr 12, 2020
Iain Buclaw
[Issue 20730] [REG 2.091] __traits(compiles) fails if any ungagged errors happened
Apr 12, 2020
Iain Buclaw
Apr 12, 2020
Iain Buclaw
Apr 12, 2020
Dlang Bot
Apr 12, 2020
Dlang Bot
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

JR <zorael@gmail.com> changed:

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

--
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org
            Summary|[REG 2.091] Template        |[REG 2.091] Gagged
                   |instantiation errors after  |__traits(compiles) fails if
                   |any real errors             |any ungagged errors
                   |                            |happened

--
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG 2.091] Gagged          |[REG 2.091]
                   |__traits(compiles) fails if |__traits(compiles) fails if
                   |any ungagged errors         |any ungagged errors
                   |happened                    |happened

--
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG 2.091]                 |[REG 2.091]
                   |__traits(compiles) fails if |__traits(compiles) fails if
                   |any ungagged errors         |any ungagged errors
                   |happened                    |occurred in compilation

--
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

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

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

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #11023 "fix Issue 20730 - [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation" fixing this issue:

- fix Issue 20730 - [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation

  When running semantic on __traits(compiles), errors are gagged, so
  there's little point checking the value of global.errors here.

  If any real problems occurred, they can be dealt with by the endGagging
  checks at the end of the function.

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

--
April 12, 2020
https://issues.dlang.org/show_bug.cgi?id=20730

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

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

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #11023 "fix Issue 20730 - [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation" was merged into stable:

- e8922ef9967772e659d03e5459bbf8993902de89 by Iain Buclaw:
  fix Issue 20730 - [REG 2.091] __traits(compiles) fails if any ungagged errors
occurred in compilation

  When running semantic on __traits(compiles), errors are gagged, so
  the saved errors count is global.gaggedErrors, and not global.errors.

  So the condition always evaluated as true if any real errors occured
  during compilation, and every subsequent __traits(compiles) errors too,
  whether it is valid syntax or not.

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

--