Open
Description
Description
the program below compiles fine, but with a warning saying that "'nonisolated(unsafe)' has no effect on property 'value', consider using 'nonisolated'".
this is false: replacing the nonisolated(unsafe)
with just nonisolated
will result in the compiler (correctly) rejecting the program.
Reproduction
import Observation
@Observable
final class Foo: Sendable {
nonisolated(unsafe) var value: Int? // warning: 'nonisolated(unsafe)' has no effect on property 'value', consider using 'nonisolated'
}
Expected behavior
the compiler should not emit this warning for this program
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0
Additional information
removing the @Observable
macro causes the warning to disappear