Skip to content

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

Merged
dlang-bot merged 1 commit intodlang:stablefrom
ibuclaw:reg20730
Apr 12, 2020
Merged

fix Issue 20730 - [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation#11023
dlang-bot merged 1 commit intodlang:stablefrom
ibuclaw:reg20730

Conversation

@ibuclaw
Copy link
Copy Markdown
Member

@ibuclaw ibuclaw commented Apr 12, 2020

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.

@dlang-bot
Copy link
Copy Markdown
Contributor

dlang-bot commented Apr 12, 2020

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
20730 regression [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#11023"

@ibuclaw ibuclaw changed the base branch from master to stable April 12, 2020 12:32
Copy link
Copy Markdown
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good minus the other 402 commits ;)

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Apr 12, 2020

@thewilsonator - I just remembered last minute that maybe should be targetting stable. ;-)

@rainers
Copy link
Copy Markdown
Member

rainers commented Apr 12, 2020

removing automerge for now, I think this just shuffles semantic analysis order, but doesn't solve the actual issue.

…d 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.
@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Apr 12, 2020

@rainers check again.

@rainers
Copy link
Copy Markdown
Member

rainers commented Apr 12, 2020

@rainers check again.

Thanks, I get it now. Using errors != global.gaggedErrors should work, too, but I actually like it better using only global.errors.

@dlang-bot dlang-bot merged commit fa488fc into dlang:stable Apr 12, 2020
@ibuclaw ibuclaw deleted the reg20730 branch April 12, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants