There is some weird generics issue I don't underst...
# tornadofx
e
There is some weird generics issue I don't understand with this task thing. If runAsync is defined like this:
fun <T> runAsync(func: () -> T) = task(func)
- then we don't need to supply a type argument, the compiler can infer
T
from the value
func
returns. However, if
func
operates` on something of type
T
, it suddenly requires that type parameter. Changing to
fun <T> runAsync(func: Task<T>.() -> T) = task(func)
is what I want to do.