Skip to content

[Sema/ClangImporter] Improvements to witness matching #72277

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 8 commits into from
Mar 19, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Mar 12, 2024

  • Fix locators for requirement-witness matching (modern locators can be anchored on declarations)

  • Warn about sendability mismatches associated with ObjC requirements

    Instead of stripping concurrency, handle stripping gracefully during repairFailures and reflect that in the solution score.
    This way we can maintain source compatibility and allow adding concurrency annotations.

  • ClangImporter: Wrap compositions with Sendable protocol into existentials

Resolves: #65730

@xedin
Copy link
Contributor Author

xedin commented Mar 12, 2024

@swift-ci please test

@ahoppen ahoppen removed their request for review March 13, 2024 17:36
@xedin
Copy link
Contributor Author

xedin commented Mar 13, 2024

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Mar 15, 2024

@swift-ci please test source compatibility release

xedin added 8 commits March 18, 2024 10:43
…t declaration

Locators used to support only expressions which is no longer the case.
…with ObjC requirements

Since importer ignored `swift_attr` that appeared in a type context
until recently we need to maintain status quo with concurrency stripping
from ObjC requirements in modes that don't have full concurrency
checking enabled.
… down to a class

`any C` where `C` is a class is not a well-formed type.
@xedin xedin force-pushed the improvements-to-protocol-witness-matching branch from edf4065 to 5890de3 Compare March 18, 2024 19:10
@xedin
Copy link
Contributor Author

xedin commented Mar 18, 2024

@swift-ci please test

Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

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

Should we replace the ObjC checks with a check for preconcurrency requirements? I think we want the same behavior for Swift requirements that are marked @preconcurrency, and ObjC isn't special other than all imported declarations are treated as @preconcurrency.

@xedin
Copy link
Contributor Author

xedin commented Mar 19, 2024

I want to investigate expanding this separately, main goal was to remove the workaround for ObjC requirements that got concurrency stripped always and thus had no path for witnesses to be updated...

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.

ClangImporter: Subclass composition from applying imported @Sendable to class type not wrapped in existential
2 participants