Any ideas how to solve this type inference issue? ...
# codereview
b
Any ideas how to solve this type inference issue? I would like to return a generic anonymous function whose type is determined by the outer function, without having to specify the type explicitly at the call site: https://stackoverflow.com/q/54799122/1772342
a
As @pakoito already pointed out, its not possible
val t = foo()
<- whats the type of t?
b
Well
T
could be provided by a DSL closure of some kind. Or, alternately, it could be a slightly different syntax. The call site currently looks like this
foo(some, parameters, t0, t1)
. I would like to separate them somehow
foo(some, parameters)(t0, t1)
, but
foo(t0, t1)(some, parameters)
or
foo(some, parameters) c (t1, t2)
would also work