Skip to content

[Sema] Permit dot reference with isolation change without call #79575

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
Apr 1, 2025

Conversation

AdamCmiel
Copy link

A dot-reference of a method defined on Self (as well as through self) should be permitted to be made in a different actor isolation than the referenced function's actor isolation if a call is not yet made, as the DeclRefExpr can store the isolation of the referenced decl. That said, we currently can only express that known isolation with global actor annotations until the language adopts closure isolation control.

Resolves (for global actors) #76453

@NuriAmari
Copy link
Contributor

@swift-ci Please test

@AdamCmiel AdamCmiel force-pushed the curried_thunk_actor_isolation branch 2 times, most recently from 171a0c9 to 51941e9 Compare February 24, 2025 13:55
@NuriAmari
Copy link
Contributor

@swift-ci Please test

@xavierjurado
Copy link

@NuriAmari
Copy link
Contributor

@swift-ci Please test

@gottesmm
Copy link
Contributor

@NuriAmari this is actually already fixed on main. https://godbolt.org/z/GjsdWv8bx.

@gottesmm
Copy link
Contributor

This is now something that is the province of region isolation. I am not sure if we actually need to muck with Sema. That being said, it would be great to transition this PR to just be for adding tests. More tests are always good.

@AdamCmiel
Copy link
Author

I'll update

@AdamCmiel AdamCmiel force-pushed the curried_thunk_actor_isolation branch from 78b7d5c to 03321b6 Compare March 27, 2025 12:54
A dot-reference of a method defined on `Self` (as well as through `self`)
should be permitted to be made in a different actor isolation than
the referenced function's actor isolation if a call is not yet made, as
the DeclRefExpr can store the isolation of the referenced decl. That said,
we currently can only express that known isolation with global actor
annotations until the language adopts closure isolation control.

This is fixed on main so just recomming for the tests
@AdamCmiel AdamCmiel force-pushed the curried_thunk_actor_isolation branch from 03321b6 to 939aaa9 Compare March 27, 2025 12:57
@AdamCmiel
Copy link
Author

AdamCmiel commented Mar 27, 2025

Updated to just include the tests. @gottesmm, better this?

@drodriguez
Copy link
Contributor

@swift-ci please test

@gottesmm
Copy link
Contributor

gottesmm commented Apr 1, 2025

LGTM. Thanks!

@gottesmm gottesmm merged commit 20b98fe into swiftlang:main Apr 1, 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.

5 participants