Open
Description
Description
I filed this bug in Feedback (FB12101395) as currently I've only been able to reproduce it in SwiftUI, but it does seem like a Swift bug in general.
Run the following code in a simulator, tap the “Go” button, and notice that the application freezes:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
NavigationLink("Go") {
DemoView()
}
}
}
}
protocol Foo<A> {
associatedtype A
}
struct Bar: Foo {
typealias A = Int
}
struct DemoView: View {
let foo: any Foo<Int> = Bar()
var body: some View {
EmptyView()
}
}
If you open the Debug Navigator in Xcode you will notice that the memory keeps growing.
This happens in Xcode 14.2+Swift 5.7 as well as Xcode 14.3+Swift 5.8.
Steps to reproduce
Run the above in a SwiftUI application.
Expected behavior
Tapping the "Go" button should drill down to the destination.
Environment
- swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
- This also happens in Swift 5.7
- Xcode 14.3, Build version 14E222b
- This also happens in Xcode 14.2
- iOS 16+