Casey Brooks
11/07/2018, 7:41 PMAny
, and Unit
is an instance of Any
. Unit
isn’t quite the same as Java’s void
, it actually is an object, so the implicitly returned Unit
object can also be cast to Any
. You’ll need to set up some kind of base class or interface that your predicate requires other than Any
. Also, the naming might be a bit confusing, as a “predicate” is usually a function which returns a Boolean