Skip to content

Requestify Operator Precedence Groups and Precedence Group Lookup #27351

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

Merged
merged 4 commits into from
Sep 25, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Sep 25, 2019

Define the LookupPrecedenceGroupRequest and OperatorPrecedenceGroupRequest for looking up an unvalidated precedence group declaration and retrieving then validating the precedence group associated with an operator respectively.

This restructures the way that we validate operator declarations and precedence group declarations. In particular, the interface the type checker vends to look up an operator will now also validate that operator rather than return it raw and expect the client to do the right thing.

This allows the remaining overloads of validateDecl to be deleted and retracted into the decl checker.

There are now 2 remaining calls to validateDecl.

Define the LookupPrecedenceGroupRequest and OperatorPrecedenceGroupRequest for looking up an unvalidated precedence group declaration and retrieving then validating the precedence group associated with an operator.

This allows us to drop both validateDecl overloads for these types out of the TypeChechecker
@CodaFi CodaFi requested a review from slavapestov September 25, 2019 00:54
@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

This is a nightmarish diff...

Restructure the way operators and precedencegroup declarations are validated.  First, factor out the common operator validation code into the DeclChecker.  Then, redo the lookup and validation code for precedence groups to work with the request model.  Finally, delete the validateDecl overloads on the TypeChecker.

Unfortunately, the evaluator is not capable of detecting all the cycles TypeCheckDecl can.  In particular, certain cross-file precedence group cycles cannot be diagnosed via  request alone.  That infrastructure all stays in place.
@CodaFi CodaFi force-pushed the not-a-good-start-boris branch from 8d9a499 to d992ff3 Compare September 25, 2019 16:55
@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

Package errors seem unrelated. Will give it another shot later.

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

@swift-ci please smoke test Linux platform

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 25, 2019

⛵️

@CodaFi CodaFi merged commit c5a27ef into swiftlang:master Sep 25, 2019
@CodaFi CodaFi deleted the not-a-good-start-boris branch September 25, 2019 20:30
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.

1 participant