I have modelled a scenario where I have a `Control...
# language-proposals
g
I have modelled a scenario where I have a
Controller<S>
and a
View<S>
and I want this to work as a cyclic dependence where the controller depends on the view indirectly. For that I was thinking on defining a
Provider
that takes a concrete controller and creates an instance of view with that injected. Currently it looks like this:
Copy code
fun interface ViewProvider<C : Controller<S>, S : State> {
    fun get(controller: C): View<S>
}
It feels redundant that I have to locally specify
S
, since
Controller<S>
already does that job. For example:
Copy code
class AController : Controller<A>
class Provider : ViewProvider<AController, A>
S
here can only be
A
, since
Controller<S>
is invariant in
S
, and here
S
is
A
. Specifying
A
looks somewhat redundant. Could the type parameter here be inferred so the client code becomes less redundant?
1
d
We already design such feature but not implemented it yet because there are some more major things to do
👍 1