mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SE-0466] Don't infer @MainActor on types conforming to Sendable
When the default isolation is main-actor, don't infer @MainActor for a type that conforms to a protocol P in its primary definition when P inherits from Sendable. Such types should remain non-isolated because they're highly unlikely to be able to implement the P conformance (which cannot be isolated). Put this feature behind a new experimental flag, SendableProhibitsMainActorInference. Implements rdar://151029300
This commit is contained in:
@@ -125,6 +125,7 @@ UNINTERESTING_FEATURE(StructLetDestructuring)
|
||||
UNINTERESTING_FEATURE(MacrosOnImports)
|
||||
UNINTERESTING_FEATURE(NonisolatedNonsendingByDefault)
|
||||
UNINTERESTING_FEATURE(KeyPathWithMethodMembers)
|
||||
UNINTERESTING_FEATURE(SendableProhibitsMainActorInference)
|
||||
|
||||
// TODO: Return true for inlinable function bodies with module selectors in them
|
||||
UNINTERESTING_FEATURE(ModuleSelector)
|
||||
|
||||
Reference in New Issue
Block a user