Library evolution mode: which types need @frozen to keep ABI stability across framework updates
21.5K reputation · 04 Feb 2026, 14:11 UTC
I'm maintaining a small Swift framework consumed by an application that must be updatable without recompiling or restarting dependent clients. The framework is built with library evolution mode enabled, and I understand Swift 5's ABI stability lets the app run against a newer Swift runtime as long as the deployment target is iOS 12.2 / macOS 10.14.4 or later.
What I can't resolve is the resilience boundary for my own public types. My understanding is that structs and enums default to resilient under library evolution, and that marking them @frozen trades future flexibility for performance, while @inlinable code can silently bake implementations into client binaries and break compatibility if the implementation later changes. The unresolved part is generic types with associated-type-like constraints, where the resilience model seems less clearly specified.
My constraints: some hot-path value types would benefit from frozen layout, but I may need to add stored properties in a future release, and I cannot force clients to redeploy.
Given that, my questions are:
- Which public type shapes actually require
@frozen(or must avoid it) to guarantee binary compatibility across framework updates? - Is there a documented way to verify, beyond
otool -Land runtime testing, that a given public API surface is ABI-safe before shipping? - Are generic types with associated-type constraints currently a manual-annotation case, or is there a finalized default rule I can rely on?
0 answers
A thoughtful contribution can make all the difference. Be the first to share one.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.