Async Result Discarded (ARCH8020)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key kotlin.async.async-result-discarded · Severity warning · Category async
Flags async { } whose Deferred is never awaited or stored - the work runs but its result and failure are lost; that is what launch is for.
Incorrect
Section titled “Incorrect”scope.async { sync() }Correct
Section titled “Correct”scope.launch { sync() }// or: val d = scope.async { load() }; d.await()Use launch for fire-and-forget work, or await the Deferred.