PreferenceKey protocol conflicts with Swift Concurrency

You are right. It should be OK to use let here.
I wasn't very sure about this so I asked ChatGPT and I got:

You're right that the defaultValue in the PreferenceKey protocol is declared as a var , and changing it to a let would indeed break the protocol conformance. The warning about concurrency is because static properties in Swift are shared across all threads, and mutable shared state can lead to race conditions.