Avatar
Avatar
Iceman
@swift-5.5.3 @propertyWrapper struct Wrap { var wrappedValue: Int var projectedValue: Int = 0 } actor A { nonisolated var a: Int = 0 @Wrap nonisolated var i: Int = 0 nonisolated var u: Wrap = .init(wrappedValue: 0) nonisolated var e: Int { $i } nonisolated var o: Wrap { _i } } (edited)
exit status: 1 with stderr:<stdin>:6:3: error: nonisolated' can not be applied to stored properties nonisolated var a: Int = 0 ^~~~~~~~~~~~ <stdin>:8:3: error: nonisolated' can not be applied to stored properties nonisolated var u: Wrap = .init(wrappedValue: 0) ^~~~~~~~~~~~ <stdin>:9:28: error: actor-isolated property '$i' can not be referenced from a non-isolated context nonisolated var e: Int { $i } ^ <stdin>:7:25: note: property declared here @Wrap nonisolated var i: Int = 0 ^ <stdin>:10:29: error: actor-isolated property '_i' can not be referenced from a non-isolated context nonisolated var o: Wrap { _i } ^ <stdin>:7:25: note: property declared here @Wrap nonisolated var i: Int = 0 ^ (edited)