Skip to content

Sema: Fix problems with checkTypeWitness() #71354

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 3 commits into from
Feb 3, 2024

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Feb 2, 2024

This came up while running our existing tests with NoncopyableGenerics turned on, but it's an old issue and closely related to a problem with superclass requirements in protocols as well.

Fixes #48770, fixes #50561, fixes #50779, fixes #51772, fixes #53012, rdar://42012633, rdar://95729075.

Our tentative witness might have weird concrete DependentMemberTypes
in it. In that case, perform a more relaxed check that can succeed
as long as the witness is not completely invalid.

This problem was exposed by existing test cases starting to fail
once implicit Copyable requirements were introduced, because these
concrete DependentMemberTypes do not conform to protocols. This now
postpones the check until all witnesses have been fully substituted.

This also fixes a long-standing bug with superclass requirements on
associated types.

Fixes swiftlang#48770,
swiftlang#51772,
rdar://95729075.
@slavapestov slavapestov force-pushed the check-type-witness-fix branch from f0159c9 to 477e057 Compare February 3, 2024 04:31
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@AnthonyLatsis
Copy link
Collaborator

@slavapestov FYI you need to add the "fixes" et al. keyword before every issue reference in order for GitHub to recognize and link them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants