thana
06/09/2020, 10:07 AMclass Foo<T> (val helper1: Helper1<T>, helper2: Helper2<T>)
. here i want Helper1
and Helper2
work on the same type T
but in fact Foo
doesn't really care about what T
actually is - they just must match.
Is there a way not having to declare the T
on Foo
itself? I don't want to write something like Foo<*>
everywhere i'm using Foo
Or maybe the better question: i sense there is some design flaw here but i cannot really put the finger on. What approaches are there, to resolve this flaw?E.Kisaragi
06/09/2020, 10:15 AMthana
06/09/2020, 10:17 AMFoo
shouldn't be genericE.Kisaragi
06/09/2020, 10:18 AMthana
06/09/2020, 10:21 AMhelper1
and helper2
?dead.fish
06/09/2020, 10:22 AMHelper<Any>
Foo
shouldn’t care about the `Helper`s generic args, right?thana
06/09/2020, 10:23 AMAny
approach, but at least it's a small improvement... i hope 😉
Thank you so far!Luis Mirabal
06/09/2020, 10:52 AM