-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[RequirementMachine] Substitution simplification records projections #41381
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
slavapestov
merged 11 commits into
swiftlang:main
from
slavapestov:rqm-simplify-substitutions-records-projections
Feb 16, 2022
Merged
[RequirementMachine] Substitution simplification records projections #41381
slavapestov
merged 11 commits into
swiftlang:main
from
slavapestov:rqm-simplify-substitutions-records-projections
Feb 16, 2022
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
When emitting a diagnostic, mark the TypeRepr as invalid and return an ErrorType to ensure that the diagnostic is not emitted again, and to muffle downstream diagnostics.
…Substitutions() Now that the PropertyMap to the concrete simplification version is optional, we can just pass nullptr here to get the old behavior where type terms are simplified to canonical anchors and no concrete simplification is performed.
The inverted form no longer has to replace substitutions; we use the inverted form of DecomposeConcrete for that. So just assert that the substitutions are equal.
…aring code with concrete simplification
…rom PropertyMap to RewriteSystem
…riends from PropertyUnification.cpp to RewriteSystem.cpp
…deSubstitutions()
- Prefer rewrite loops not involving Decompose - Prefer more deeply nested concrete types
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test macOS |
@swift-ci Please smoke test macOS |
1 similar comment
@swift-ci Please smoke test macOS |
@swift-ci Please smoke test macOS |
1 similar comment
@swift-ci Please smoke test macOS |
swiftlang/llvm-project#3952 |
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.
The Requirement Machine had three components that did similar things:
T.[concrete: G<Y>] => T
down toT.[concrete: G<X>] => T
, givenY => X
T.[concrete: G<X>] => T
down toT.[concrete: G<Int>] => T
, givenX.[concrete: Int] => X
T.[concrete: G<X>] => T
andT.[concrete: G<Y>] => T
, it would record an induced ruleY => X
.There were two problems here:
Additionally, this PR fixes a couple of unrelated issues where Sema would emit duplicate diagnostics when resolving TypeReprs; in particular, this would manifest when running tests with -requirement-machine-inferred-signatures=verify, which resolves each TypeRepr appearing in a where clause twice (once for the GSB and once for the RequirementMachine).