My code (below) is failing to compile after a Doobie library upgrade. fragments.or(filterFragments: _*) "Cannot resolve overloaded method 'or'". Presumably the signature has changed but I cant get it work in the same as it did before the upgrade. Am I missing something?
def statusFilter(queryCriteria: QueryCriteria): Option[Fragment] =
queryCriteria.statusFilter.map { filters =>
val filterFragments: List[Fragment] = filters.map {
case StatusFilter(Open, date) => statusFilterOpen(date)
case StatusFilter(Upcoming, date) => statusFilterUpcoming(date)
case StatusFilter(Closed, date) => statusFilterClosed(date)
case _ => fr""
}.toList
fragments.or(filterFragments: _*)
}
In RC2 the method is
but In RC4 that signature was removed and replaced with two different overloads:
The RC3 Release Notes mention "Improved composability and safety of fragment helpers
(doobie.util.fragments.*)"Seems like the goal was to prevent passing zero fragments to the
ormethod. If you can construct acats.NonEmptyList[Fragment], you should be able to pass that directly to the first version that expects anF[Fragment]without a:_*signal, since NonEmptyList has aReducibleinstance.Listdoes not have aReduciblesince that typeclass comes with the expectation of the collection being non-empty.