@SectionedFetchRequest Type of expression is ambiguous

Viewed 34

I cant compile because of an error on my SectionedFetchRequest. Gives the error: Type of expression is ambiguous without more context

struct FlightListView: View {
@Environment(\.managedObjectContext) private var viewContext
@FetchRequest(
    sortDescriptors: [NSSortDescriptor(keyPath: \Flight.trip?.date, ascending: true)],
    animation: .default)
private var flights: FetchedResults<Flight>

@SectionedFetchRequest<String, Flight>(
    sectionIdentifier: \.trip?.sortDate as? String,
    sortDescriptors: [NSSortDescriptor(keyPath: \Flight.trip?.date, ascending: true)],
    predicate: nil,
    animation: .default)
private var groupedFlights: SectionedFetchRequest<String, Flight>

The regular fetch request compiles and is fine. I cant figure out whats incorrect with my code.

0 Answers
Related