Its because T and C are bounded to `Any`, and `Uni...
# announcements
c
Its because T and C are bounded to
Any
, 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