jcavar
(Josip Cavar)
1
I've downloaded latest nightly toolchain and this code compiles without error:
@available(macOS 9999, *)
class Test {
private var x = Atomic<Int>(1)
func test() {
x.store(2, ordering: .relaxed)
}
}
My understanding of SE-0410 is that this should be an error?
1 Like
MahdiBM
(Mahdi Bahrami)
2
The behavior is hidden behind the StaticExclusiveOnly experimental feature flag which enables a new @_staticExclusiveOnly attribute which basically results in the behavior you're expecting, when applied to non-copyable types like the new Atomic type.
Try declaring that in your Package.swift or adding it like -enable-experimental-feature StaticExclusiveOnly to the swift invocation when using CLI.
2 Likes
MahdiBM
(Mahdi Bahrami)
3
1 Like
Joe_Groff
(Joe Groff)
4
The intent is for the checking to ultimately be enabled unconditionally, so at some point we should enable the experimental feature flag.
2 Likes
MahdiBM
(Mahdi Bahrami)
5
1 Like
Alejandro
(Alejandro Alonso)
6
This is incorrectly checking the client's experimental features when determining if something should be a let or not. Right, the intent was that you cannot utter @_staticExclusiveOnly unless you have the flag on. I'll make a patch here real quick.
7 Likes