I had another situation involving SwiftUI with the same error message: Type 'any Identifiable' cannot conform to 'Identifiable'.
I was building on normal project with Xcode 14 beta 2. The project doesn't build with or without the compiler flag -Xfrontend -enable-experimental-opened-existential-types as suggested in prev comment.
import SwiftUI
struct A: Identifiable{
let id = UUID()
}
struct B: Identifiable {
let id = UUID()
}
struct ContentView: View {
let container: [any Identifiable] = [A(), B()]
var body: some View {
VStack {
ForEach(container) { item in
Text("\(item.id)")
}
}
}
}