Skip to content

[GSB] Basic infrastructure for delaying and reprocessing requirements #8707

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 5 commits into from
Apr 12, 2017

Conversation

DougGregor
Copy link
Member

Start staging in support for delaying the processing of a requirement in the GenericSignatureBuilder when one of the involved types cannot be immediately resolved. In such cases, stash the requirement to be resolved later. Most of this infrastructure is unused at this point, but is important for the detection of recursion in constraint systems.

While here... fix an issue where the GenericSignatureBuilder was placing conformance requirements on the representative of the equivalence class rather than on the potential archetype that was named, which breaks some invariants. That in turn uncovered a latent idempotency problem in the GSB, where we wouldn't necessarily have the appropriate anchor within a component within the implied same-type constraint graphs.

Rather than true (an error occurred) or false (the constraint was
resolved), introduce ConstraintResult to better model what
happened. NFC for now, but the intent here is to report unresolved
constraints through this mechanism.
We were putting conformance requirements on the representative of the
equivalence class, rather than directly on the potential archetype on
which the conformance requirement was specified. This violates the
invariant used when forming protocol-requirement sources that we never
reseat a requirement onto the representative (which would
have become a problem when implementing recursive protocol
constreaints) as well as masking a GSB idempotency issue that comes
from same-type requirements where the right-hand side was not
guaranteed to refer to the archetype anchor *within* that subcomponent.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

Foundation failure looks like a spurious networking issue.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@nkcsgexi nkcsgexi requested review from huonw and removed request for huonw April 11, 2017 22:29
@nkcsgexi
Copy link
Contributor

I mis-clicked the request for review button. Sorry : (

@DougGregor
Copy link
Member Author

The Linux failure will be addressed by swiftlang/swift-corelibs-foundation#945

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

@slavapestov RequirementResult would be better, probably. Will update

@DougGregor DougGregor merged commit 5dadfa8 into swiftlang:master Apr 12, 2017
@DougGregor DougGregor deleted the gsb-delayed-reqs branch April 12, 2017 06:28
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.

3 participants