when I dont' use the result of the builtin `copy()...
# announcements
k
when I dont' use the result of the builtin
copy()
function of data classes Intellij highlights the code as a warning (with error of "Unused result of data class copy"). is there a way to get warning activated for my own functions, when I don't use the result value?
n
i
Although note that there are Android only (https://developer.android.com/reference/kotlin/androidx/annotation/CheckResult) and Compose (https://developer.android.com/reference/kotlin/androidx/compose/runtime/CheckResult) versions of that annotation already if you're working on those specific platforms/feature sets
k
thanks for the info, will be watching the issue...
r
How about a
pure
keyword (or
@Pure
if it has to be an annotation)? Less verbose, and by definition there’s no point calling a pure function unless you use the result.
n
yeah, the converse isn't true though
you may want to enforce users to look at the result even if it's not pure
102 Views