Skip to content

[NFC] Make RequirementRepr a Purely Syntactic Object #32331

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 8 commits into from
Jun 12, 2020

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Jun 11, 2020

Remove the TypeLoc in RequirementRepr and fixup all the data dependencies and users.

CodaFi added 8 commits June 11, 2020 16:02
It was just using them as a currency type because performTypeLocChecking accepted them as a parameter. Cleaning up performTypeLocChecking is something that needs to be done independently of this changeset, so for now just encapsulate the use of TypeLocs as much as possible and use TypeRepr instead.
If a semantic representation of the RequirementRepr is needed, then it should be resolved to a Requirement and printed.
This method performs a linear-ish search over all the generic requirements and tries to pull out a matching written requirement so it can provide a richer diagnostic. Unpack this search, teach it to walk resolved requirements, and clean up the code here.
There is no need to build a fake RequirementRepr if we can directly represent a the requested AnyObject conformance constraint in the generated generic signature.

This removes the final user of the TypeLoc-bearing constructors of RequirementReprs.
Resolve the written type instead of the semantic type since that's the only data these requests will have access to once RequirementRepr is made completely syntactic.
In preparation for the removal of the TypeLocs here, cache down the resulting Requirement from a RequirementRepr.
Now that the previous commits have removed the data dependencies on TypeLoc, remove the TypeLoc and replace it with a TypeRepr. This makes RequirementRepr a purely syntactic object once again.
@CodaFi CodaFi requested a review from DougGregor June 11, 2020 23:21
@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 11, 2020

@swift-ci smoke test Linux

@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 12, 2020

@swift-ci smoke test macOS

1 similar comment
@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 12, 2020

@swift-ci smoke test macOS

@CodaFi CodaFi merged commit fc33bae into swiftlang:master Jun 12, 2020
@CodaFi CodaFi deleted the no-where-clause-for-alarm branch June 12, 2020 08:57
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