-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[GenericSignatureBuilder] Remove self-derived same-type-to-concrete constraints. #7812
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
DougGregor
merged 7 commits into
swiftlang:master
from
DougGregor:self-derived-constraints
Feb 28, 2017
Merged
[GenericSignatureBuilder] Remove self-derived same-type-to-concrete constraints. #7812
DougGregor
merged 7 commits into
swiftlang:master
from
DougGregor:self-derived-constraints
Feb 28, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whenever we create a (root) requirement source, associate it with the potential archetype on which the requirement is written. This lets us follow a requirement source from the (stated or implied) requirement on the root potential archetype to the effective requirement on the resulting potential archetype. Introduce FloatingRequirementSource for the cases where we need to state what the root source is, but don't yet have a potential archetype to attach it to. These get internally resolved to RequirementSources as soon as possible.
Use TrailingObjects to help us efficiently store the root potential archetype within requirement sources, so we can reconstruct the complete path from the point where a requirement was created to the potential archetype it affects. The test changes are because we are now dumping the root potential archetype as part of -debug-generic-signatures.
Introduce an operation on RequirementSource to determine whether a constraint with such a source, when it lands on a given potential archetype, is "self-derived": e.g., the final constraint is derived from the original constraint. Remove such constraints from the system during finalization, because otherwise they would make the original constraint redundant. Fixes rdar://problem/30478915, although we still need to apply this same logic to other kinds of constraints in the system.
2b94c65
to
5ec3857
Compare
@swift-ci please smoke test and merge |
@shahmishal, any idea why I'm unable to trigger CI? |
@swift-ci please smoke test and merge |
GitHub Status (https://status.github.com/messages)
|
Okay, thank you @shahmishal ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce an operation on
RequirementSource
to determine whether aconstraint with such a source, when it lands on a given potential
archetype, is "self-derived": e.g., the final constraint is derived
from the original constraint. Remove such constraints from the system
during finalization, because otherwise they would make the original
constraint redundant.
To get here, extend
RequirementSource
to store the rootPotentialArchetype
(on which the constraint was generated) as well as theAssociatedTypeDecl
for each nested type access. We can now follow the paths more predictably.Fixes rdar://problem/30478915, although we still need to apply this
same logic to other kinds of constraints in the system.