Skip to content

varargs does not works #113

@clives

Description

@clives

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)
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions