I expected the SwiftUI view to compile correctly and display each life area with its associated name, image, slider, and buttons. The @ViewBuilder should be able to handle conditional content rendering without throwing errors.
Environment
Swift 5.7.2
Xcode 14.5 (Build 14E350)
macOS 13.0 Ventura
Additional information
This error consistently occurs when using @ViewBuilder with conditional content inside a VStack. Xcode returns the following error message: "Failed to produce diagnostic for expression; please submit a bug report."
Related discussion: https://developer.apple.com/forums/thread/657391
Description
No response
Reproduction
@ViewBuilder private func lifeAreaView(for index: Int, isMiniFormat: Bool) -> some View { if index >= lifeAreas.count { Text("Life Area not found") .foregroundColor(.red) .background(Color.white) .cornerRadius(15) .shadow(radius: 5) .padding(10) } else { VStack(spacing: 15) { Text(lifeAreas[index].name) .font(.headline) .foregroundColor(.blue) .padding(.bottom, 5)
}
Expected behavior
I expected the SwiftUI view to compile correctly and display each life area with its associated name, image, slider, and buttons. The
@ViewBuilder
should be able to handle conditional content rendering without throwing errors.Environment
Swift 5.7.2 Xcode 14.5 (Build 14E350) macOS 13.0 Ventura
Additional information
This error consistently occurs when using @ViewBuilder with conditional content inside a VStack. Xcode returns the following error message: "Failed to produce diagnostic for expression; please submit a bug report." Related discussion: https://developer.apple.com/forums/thread/657391