Skip to content

Commit

Permalink
Fixing filtering function for Scala 2.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed May 9, 2020
1 parent 89c0e47 commit 0d0d3af
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ object hlist {
def filterUnit[R <: HList](implicit w: Filter.Aux[T, R]): R = {
def go(ys: HList, res: HList): HList =
ys match {
case HNil => res
case HCons(h, t) if h == () => go(t, res)
case HCons(h, t) => go(t, h :: res)
case HNil => res
case HCons(h, t) if h.isInstanceOf[Unit] => go(t, res)
case HCons(h, t) => go(t, h :: res)
}
go(t, HNil).reverse.asInstanceOf[w.R]
}
Expand Down

0 comments on commit 0d0d3af

Please sign in to comment.