Skip to content

RequirementMachine: Fix terrible bug in minimization of protocol inheritance #41851

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

Conversation

slavapestov
Copy link
Contributor

Fixes rdar://problem/90402503.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test MacOS

llvm::MapVector<unsigned, std::vector<SmallVector<unsigned, 2>>> ConformancePaths;

// The set of conformance rules which are protocol refinements, that is rules of
// the form [P].[Q] => [P].
// The set of conformance rules (from all minimization dmains) which are protocol

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// The set of conformance rules (from all minimization dmains) which are protocol
// The set of conformance rules (from all minimization domains) which are protocol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

…e refinement

Without this, we only considered a protocol refinement rule redundant if
it was derived by directly-stated protocol refinements. But this broke
when completion introduced a 'transitive' refinement [P].[R] => [P]
from two directly-stated refinements [P].[Q] => [P] and [Q].[R] => [Q].

Fixes rdar://problem/90402503.
@slavapestov slavapestov force-pushed the rqm-fix-protocol-refinement-bug branch from ad55e8c to 30da30e Compare March 17, 2022 19:06
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit ce75256 into swiftlang:main Mar 17, 2022
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.

2 participants