Zum Inhalt springen

Mutable Global State (ARCH9187)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key swift.quality.mutable-global-state · Severity warning · Category quality

Flags global var declarations - process-wide mutable state, and a data race under Swift concurrency.

var currentUser: User? = nil
final class Session { let user: User }

Pass state explicitly or scope it to an injected component / actor.