The Wire · Showcase
SWIFT COMPILER FIXES NESTED FUNCTION CORRUPTION IN BACKDEPLOYED CODE
By RepoJournal · Filed · About Mobile platforms
Swift's SILGen pipeline was silently emitting duplicate nested functions when processing `@backDeployed` declarations, causing build failures that looked impossible to debug.
The top priority fix lands in Swift's SILGen phase, which handles intermediate language generation [1]. When a function marked `@backDeployed` gets compiled, its body is emitted twice - once for the original and once for the fallback that runs on older OS versions. Named nested functions inside that body were getting duplicate definitions, while closures worked fine because they already had deduplication logic. This is fixed now, unblocking developers using `@backDeployed` with local function declarations.
On the embedded Swift front, a false error is resolved that was rejecting legitimate generic specialization loops [2]. The compiler now allows specialization chains up to a depth of 10 instead of 1, which matches real-world usage patterns without opening the door to infinite loops. This removes friction from embedded projects that were hitting artificial constraints.
Two additional ownership violations surfaced in the inliner when handling dead-end control flow [3]. The lifetime completion ordering issue caused `end_borrow` to be inserted after `destroy_value [dead_end]` on the same value, violating Swift's ownership model. This is now corrected.
On the Kotlin side, Atomicfu's type parameter generation has been fixed to prevent out-of-scope references [4], addressing KT-69305 and clearing the path for atomic operations in more complex generic contexts.
Action items
- → Sync Swift compiler if you maintain `@backDeployed` APIs or embedded Swift projects apple/swift [plan]
- → Monitor Kotlin/Atomicfu for the next release with KT-69305 included JetBrains/kotlin [monitor]
References
- [1] SILGen: Fix 'multiple definitions' error for funcs nested in `@backDeployed` funcs ↗ apple/swift
- [2] embedded: allow finite specialization loops up to a larger limit ↗ apple/swift
- [3] Inliner: fix a ownership violation when inlining a begin_apply into a dead-end block ↗ apple/swift
- [4] [Atomicfu] Fix out-of-scope type parameters generation JetBrains/kotlin
FAQ
- What changed in Mobile platforms on June 1, 2026?
- Swift's SILGen pipeline was silently emitting duplicate nested functions when processing `@backDeployed` declarations, causing build failures that looked impossible to debug.
- What should Mobile platforms teams do about it?
- Sync Swift compiler if you maintain `@backDeployed` APIs or embedded Swift projects • Monitor Kotlin/Atomicfu for the next release with KT-69305 included
- Which Mobile platforms repositories shipped on June 1, 2026?
- apple/swift, JetBrains/kotlin