Sema: Fix concurrency adjustment for member operator references #84798
+19
−14
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.
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.