Hi folks, i've been getting a weird not helpful error when trying to use SwiftData and WindowGroup, here's the error:
Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
And here's my app file:
struct DocumentApp: App {
private var container = try! ModelContainer(for: Document.self)
var body: some Scene {
WindowGroup(id: "main") {
InfoWindow()
}
.modelContainer(container)
.windowResizability(.contentSize)
WindowGroup(id: "note", for: Document.Note.ID.self) { $detailID in
@Query var documents: [Document]
let openDoc = documents.first { $0.id == "\($detailID)" }
NoteView(note: openDoc?.notes)
}
.defaultSize(CGSize(width: 550, height: 550))
.windowResizability(.contentSize)
ImmersiveSpace(id: "board") {
ProjectBoard()
.modelContainer(container)
}
.immersionStyle(selection: .constant(.mixed), in: .mixed)
}
}
Thanks to anyone who took the time to read this post!