Skip to content

[AST] Do not verify when allowing compiler errors #37667

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

Closed
wants to merge 1 commit into from

Conversation

bnbarham
Copy link
Contributor

It isn't unexpected to have an invalid AST when allowing errors, so make
sure not to verify the AST in that case.

It isn't unexpected to have an invalid AST when allowing errors, so make
sure not to verify the AST in that case.
@bnbarham bnbarham requested a review from akyrtzi May 27, 2021 07:09
@bnbarham
Copy link
Contributor Author

@akyrtzi there's a hidden frontend option -disable-ast-verifier that we could use rather than adding an extra condition to that function. Thoughts?

@akyrtzi
Copy link
Contributor

akyrtzi commented May 27, 2021

@akyrtzi there's a hidden frontend option -disable-ast-verifier that we could use rather than adding an extra condition to that function. Thoughts?

This gets into compiler implementation details, I don't think a build system should need to be aware of such a flag.
And it's implementation detail about what a verifier is doing, e.g. we could have an AST verifier that checks things that apply when allowing errors as well instead of disabling it completely.

To double check, the AST verifier only runs when assertions are enabled, right?

@bnbarham
Copy link
Contributor Author

To double check, the AST verifier only runs when assertions are enabled, right?

Or specifically enabled, yeah.

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham
Copy link
Contributor Author

Turns out that this is actually due to the skip function bodies flag. I'll look into it more, will convert this to draft for now so we don't accidentally merge.

@bnbarham bnbarham marked this pull request as draft May 28, 2021 01:22
@bnbarham
Copy link
Contributor Author

Fixed this differently in #37701 - it was due to differing behaviour with a missing right brace in delayed vs non-delayed parsing.

@bnbarham bnbarham closed this May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants