swift icon indicating copy to clipboard operation
swift copied to clipboard

[Sema] Permit dot reference with isolation change without call

Open AdamCmiel opened this issue 10 months ago • 9 comments

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

AdamCmiel avatar Feb 24 '25 13:02 AdamCmiel

@swift-ci Please test

NuriAmari avatar Feb 24 '25 13:02 NuriAmari

@swift-ci Please test

NuriAmari avatar Feb 24 '25 13:02 NuriAmari

Related: https://feedbackassistant.apple.com/feedback/15965823

xavierjurado avatar Feb 24 '25 14:02 xavierjurado

@swift-ci Please test

NuriAmari avatar Feb 25 '25 16:02 NuriAmari

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

gottesmm avatar Mar 24 '25 23:03 gottesmm

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.

gottesmm avatar Mar 24 '25 23:03 gottesmm

I'll update

AdamCmiel avatar Mar 25 '25 16:03 AdamCmiel

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

AdamCmiel avatar Mar 27 '25 12:03 AdamCmiel

@swift-ci please test

drodriguez avatar Mar 27 '25 16:03 drodriguez

LGTM. Thanks!

gottesmm avatar Apr 01 '25 21:04 gottesmm