https://kotlinlang.org logo
Title
k

karelpeeters

03/04/2018, 3:23 PM
more values are of type
Any
compared to
String
But less values are of type
(Any) -> Unit
then of
(String) -> Unit
, so the former is more specific.
a

Andreas Sinz

03/04/2018, 3:31 PM
I've correct my answer because I realized to late that you talked about
T
vs
Any
not
String
vs
Any
being "more specific" depends on the context
Any
is less specific compared to
String
when you look at the possible values it can hold. On the other hand
Any
is more specific compared to
String
when you look at the possible operations you can do with them
k

karelpeeters

03/04/2018, 3:34 PM
True, I only focused on the specific problem @jdiaz was having.
👍 1
a

araqnid

03/05/2018, 12:07 PM
Producer Extends (covariance), Consumer Super (contravariance)