Gabriel
10/24/2020, 2:32 PMGabriel
10/24/2020, 2:38 PMfun <T, E> Map<T, E>.toArgString(): String = map { "${it.key}=${it.value}" }.joinToString("&")
araqnid
10/24/2020, 5:30 PM@JvmName
to prevent the method naming clash.
And in this case you can just use Map<*, *>.toArgString()
since you don’t really care what T or E arearaqnid
10/24/2020, 5:32 PMMap<String, Any>
would work too (or Map<String, Any?>
) — the key parameter to Map
is invariant, which is why Map<Any,Any>
doesn’t work (but Map<*,*>
works around that)Gabriel
10/24/2020, 6:22 PM