simulacrum icon indicating copy to clipboard operation
simulacrum copied to clipboard

varargs does not works

Open clives opened this issue 7 years ago • 2 comments

Hi, how can define function with varargs ?

b can not be A*, does works with List[A]. Any idea how to make it works? Thanks @typeclass trait CanTruthy[A] { self => /** Return true, if a is truthy. / def truthy(a: A, b: A): Boolean } object CanTruthy { def fromTruthy[A](f: A => Boolean): CanTruthy[A] = new CanTruthy[A] { def truthy(a: A, b: A*): Boolean = f(a) } }

clives avatar Sep 28 '18 20:09 clives

@clives raising a PR

DarrenBishop avatar Mar 27 '24 19:03 DarrenBishop

Raised https://github.com/typelevel/simulacrum/pull/236

DarrenBishop avatar Mar 27 '24 21:03 DarrenBishop