In TornadoFX the runAsyncWithProgress
function is currently (as of version 1.7.19) defined as:
fun <T : Any> Node.runAsyncWithProgress(progress: Node, op: () -> T): Task<T>
The Any
bound on T
prohibits me from using nullable types like String?
. This is very inconvenient when the operation can have a 'null result' (by being cancelled for example).
I noticed that runAsync
does support nullable values, is there a reason for this difference or is it some kind of oversight? I couldn't find anything in the source code that would cause issues with possibly-null values.
事实证明,这确实是一个疏忽,现在已得到修复。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.