I have a generic input parameter for a wrapper aro...
# announcements
o
I have a generic input parameter for a wrapper around function
(INPUT) -> RESULT
. Now I have some extension functions for that wrapper class, like such:
fun TestInputs<Any, SomeResult>.foo()
. However, I can't call the extension function if I have a
TestInputs<String, SomeResult>
. So I tried extracting it to a generic parameter:
fun <EXTIN: Any> TestInputs<EXTIN, SomeResult>.foo()
, but now I can't call this method inside the extension function:
converts(input: I, result: R)
with a String, because the
input
parameter becomes
EXTIN
, which extends
Any
, but which String apparently doesn't extend. I'm confused on that last point, why can I not pass a
String
to a method which should take
Any
, and how can I make it work?