Skip to content

[6.2] Change send-never-sendable of isolated partial applies to use SIL level info instead of AST info. #82196

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 1 commit into from
Jun 12, 2025

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jun 11, 2025

Explanation: This PR changes how we emit errors when sending values that can never be sent to use SIL level routines instead of AST level routines. Because we were using AST level routines, we attempted to emit an error for the self sourceloc which in a method does not exist. So we were emitting the error at . Now that we are using the SIL level routines, we emit the actual error at the use source loc and use the name of the captured variable.

Scope: Just changes how we emit an error. The actual code that identifies errors is unchanged.

Resolves: rdar://151955519

Main PR: #82149

Risk: Low. This does not impact where we emit errors... it just changes the way the errors look.

Testing: Added compiler tests

Reviewer: @xedin

…el info instead of AST info.

The reason I am doing this is that we have gotten reports about certain test
cases where we are emitting errors about self being captured in isolated
closures where the sourceloc is invalid. The reason why this happened is that
the decl returned by getIsolationCrossing did not have a SourceLoc since self
was being used implicitly.

In this commit I fix that issue by using SIL level information instead of AST
level information. This guarantees that we get an appropriate SourceLoc. As an
additional benefit, this fixed some extant errors where due to some sort of bug
in the AST, we were saying that a value was nonisolated when it was actor
isolated in some of the error msgs.

rdar://151955519
(cherry picked from commit f312369)
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm marked this pull request as ready for review June 12, 2025 20:08
@gottesmm gottesmm requested a review from a team as a code owner June 12, 2025 20:08
@gottesmm gottesmm merged commit 479dcd0 into swiftlang:release/6.2 Jun 12, 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