@@ -63,7 +63,11 @@ public class RawSyntaxArena {
6363 ///
6464 /// - Important: This is only intended to be used for assertions to catch
6565 /// retain cycles in syntax arenas.
66- fileprivate let hasParent : UnsafeMutablePointer < AtomicBool >
66+ /// - Note: `UnsafeMutableRawPointer` + casting accessor is a workaround to silence the warning 'cannot bypass resilience'.
67+ private let _hasParent : UnsafeMutableRawPointer
68+ fileprivate func hasParent( ) -> UnsafeMutablePointer < AtomicBool > {
69+ _hasParent. assumingMemoryBound ( to: AtomicBool . self)
70+ }
6771 #endif
6872
6973 /// Construct a new ``RawSyntaxArena`` in which syntax nodes can be allocated.
@@ -75,7 +79,7 @@ public class RawSyntaxArena {
7579 self . allocator = BumpPtrAllocator ( initialSlabSize: slabSize)
7680 self . childRefs = [ ]
7781 #if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
78- self . hasParent = swiftsyntax_atomic_bool_create ( false )
82+ self . _hasParent = UnsafeMutableRawPointer ( swiftsyntax_atomic_bool_create ( false ) )
7983 #endif
8084 }
8185
@@ -84,7 +88,7 @@ public class RawSyntaxArena {
8488 child. release ( )
8589 }
8690 #if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
87- swiftsyntax_atomic_bool_destroy ( self . hasParent)
91+ swiftsyntax_atomic_bool_destroy ( self . hasParent ( ) )
8892 #endif
8993 }
9094
@@ -153,7 +157,7 @@ public class RawSyntaxArena {
153157
154158 #if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
155159 precondition (
156- !swiftsyntax_atomic_bool_get( self . hasParent) ,
160+ !swiftsyntax_atomic_bool_get( self . hasParent ( ) ) ,
157161 " an arena can't have a new child once it's owned by other arenas "
158162 )
159163 #endif
@@ -299,12 +303,12 @@ struct RawSyntaxArenaRef: Hashable, @unchecked Sendable {
299303 #if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
300304 /// Accessor for the underlying's `RawSyntaxArena.hasParent`
301305 var hasParent : Bool {
302- swiftsyntax_atomic_bool_get ( value. hasParent)
306+ swiftsyntax_atomic_bool_get ( value. hasParent ( ) )
303307 }
304308
305309 /// Sets the `RawSyntaxArena.hasParent` on the referenced arena.
306310 func setHasParent( _ newValue: Bool ) {
307- swiftsyntax_atomic_bool_set ( value. hasParent, newValue)
311+ swiftsyntax_atomic_bool_set ( value. hasParent ( ) , newValue)
308312 }
309313 #endif
310314
0 commit comments