swift icon indicating copy to clipboard operation
swift copied to clipboard

[Concurrency] Allow explicit 'nonisolated' on lazy properties and properties with property wrappers if they are a member of a non-'Sendable' type.

Open simanerush opened this issue 9 months ago • 4 comments

Allow spelling the nonisolated modifier for lazy properties and properties with property wrappers if the property is a member of a non-Sendable type. In general, nonisolated is not supported on such properties, but it should be under the rule proposed in SE-0449 which allowed spelling the implicit nonisolated on a property of a non-Sendable type. This PR also removes the lazy property/property-wrapper specific diagnostic and allows such properties to go through the normal nonisolated attribute checking.

Resolves rdar://144659578.

simanerush avatar Mar 10 '25 22:03 simanerush

@swift-ci please smoke test

simanerush avatar Mar 14 '25 17:03 simanerush

Can you please make sure they are still banned in a distributed actor? It is super disallowed to have any kind of obsoleted stored state in a distributed actor since the reference may be remote. It may just work since an actor is sendable but let’s make sure with a test

ktoso avatar Mar 15 '25 03:03 ktoso

@swift-ci please smoke test

simanerush avatar Aug 08 '25 23:08 simanerush

@swift-ci please smoke test

hborla avatar Sep 17 '25 21:09 hborla

Unrelated failures


08:28:40  ✘ Test swiftTestXMLOutputFailureMessage(buildSystem:tcdata:) recorded a known issue with 2 arguments buildSystem → .swiftbuild, tcdata → (fixtureName: "Miscellaneous/TestMultipleFailureSwiftTesting", testRunner: CommandsTests.TestCommandTests.TestRunner.SwiftTesting, enableExperimentalFlag: false, matchesPattern: ["ST Test failure 1", "ST Test failure 2", "ST Test failure 3", "ST Test failure 4", "ST Test failure 5", "ST Test failure 6", "ST Test failure 7", "ST Test failure 8", "ST Test failure 9", "ST Test failure 10"], configuration: PackageModel.BuildConfiguration.release, id: "Multiple Swift Testing Tests Failure Message With Flag Disabled") at TestCommandTests.swift:660:17: Expectation failed: (FileManager.default → FoundationEssentials.FileManager).fileExists(atPath: xUnitUnderTest.pathString → "/tmp/Miscellaneous_TestMultipleFailureSwiftTesting.EG0d5t/Miscellaneous_TestMultipleFailureSwiftTesting/result-swift-testing.xml")
08:28:40  ↳ // THEN we expect \(xUnitUnderTest) to exists
08:28:40  ↳ FileManager.default: FoundationEssentials.FileManager → FoundationEssentials.FileManager
08:28:40  ↳ xUnitUnderTest.pathString: Swift.String → "/tmp/Miscellaneous_TestMultipleFailureSwiftTesting.EG0d5t/Miscellaneous_TestMultipleFailureSwiftTesting/result-swift-testing.xml"
08:28:40  ✘ Test swiftTestXMLOutputFailureMessage(buildSystem:tcdata:) recorded a known issue with 2 arguments buildSystem → .swiftbuild, tcdata → (fixtureName: "Miscellaneous/TestMultipleFailureSwiftTesting", testRunner: 

ktoso avatar Sep 18 '25 06:09 ktoso

@swift-ci please smoke test Linux

ktoso avatar Sep 18 '25 06:09 ktoso

@swift-ci please smoke test

simanerush avatar Sep 25 '25 01:09 simanerush

@swift-ci please clean smoke test

simanerush avatar Sep 25 '25 17:09 simanerush

@swift-ci please clean smoke test macOS

simanerush avatar Sep 29 '25 21:09 simanerush