https://kotlinlang.org logo
#codereview
Title
# codereview
b

breandan

02/21/2019, 3:03 PM
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

Andreas Sinz

02/21/2019, 3:10 PM
As @pakoito already pointed out, its not possible
val t = foo()
<- whats the type of t?
b

breandan

02/21/2019, 3:55 PM
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