Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 12, 2020

Conversation

ibuclaw
Copy link
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
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
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
Member Author

ibuclaw commented Apr 12, 2020

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

src/dmd/traits.d Outdated Show resolved Hide resolved
@rainers
Copy link
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
Member Author

ibuclaw commented Apr 12, 2020

@rainers check again.

@rainers
Copy link
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