It's not enforceable by the compiler, therefore there is no explicit warning or error. SwiftUI already traps if you try to use some property wrappers outside body which tells you the framework contract.
To conclude the discussion, there is NO problem here except people misunderstanding what State is build for. I mentioned it above already and you should really think about this. Every so called "View" in SwiftUI is completely immutable. Even if you add var foo: Type, you won't be able to mutate it because body is read only, because it's a non mutating property. To allow mutation and local / referenced storage or models, SwiftUI provides you things like State (local), ObservedObject (referenced), Environment (local copy), EnvironmentalObject (referenced), etc. It's been mentioned upthread dozen times, it's been mentioned during WWDC and on a lot of blog posts that State should mimic local / view private storage. State is a property wrapper that tells the framework "hey for this view I need some mutable storage, can you please create it for me?!". The framework then creates a referenced storage (hence nonmutating set on State's wrappedValue) for this unique view and injects it into your State before each body call. This is transparent to the user as it's an implementation detail and simply the way this property wrapper and mutation is designed for SwiftUI. This storage is initialized with the very first value you provide, which could be either through the default property value or through the init. However if you do it through the init, it won't reach the referenced storage the framework creates anymore, except in the case where the same view is replaced by another similar view but which internally has a different unique id. In that case the old storage is destroyed and you get a new one. If you happen to update the wrapped property, SwiftUI will update the referenced storage with the new value, hence I said it's cached. Long story short, there is no caching problem, there is no real problem with State, it works as advertised. The only issue is that people have hard times understanding these things.