Skip to content

Conversation

slavapestov
Copy link
Contributor

There was a typo in the code which made us ignore the result of the adjusted operator reference.

This was a regression from commit 1efc9a6.

It doesn't actually matter if an immediately-applied function reference is @Sendable or not... But, there is another hack in CSApply which devirtualizes a call to a member operator in a protocol, and the @Sendable mismatch made us skip this hack.

Skipping the devirtualization hack, in turn, allowed code that calls == on two Foundation.Data instances to type check with MemberImportVisibility off. Once again, this is probably a mistake, but it caused a regression where existing code stopped working.

Ideally, we should teach MemberImportVisibility about conformances, remove the devirtualization hack, and also skip the @Sendable adjustment except when the member reference is unapplied.

But the existing logic was clearly wrong, so let's fix it.

Fixes rdar://162130647.

There was a typo in the code which made us ignore the result of
the adjusted operator reference.

This was a regression from commit 1efc9a6.

It doesn't actually matter if an immediately-applied function
reference is `@Sendable` or not... But, there is another hack in
CSApply which devirtualizes a call to a member operator in a
protocol, and the `@Sendable` mismatch made us *skip* this hack.

Skipping the devirtualization hack, in turn, allowed code that
calls `==` on two Foundation.Data instances to type check with
MemberImportVisibility off. Once again, this is probably a
mistake, but it caused a regression where existing code stopped
working.

Ideally, we should teach MemberImportVisibility about conformances,
remove the devirtualization hack, and also skip the `@Sendable`
adjustment except when the member reference is unapplied.

But the existing logic was clearly wrong, so let's fix it.

Fixes rdar://162130647.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 773d327 into swiftlang:main Oct 10, 2025
5 checks passed
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