return statement.
If the unused expression is the last statement in a function and its type matches the function's return type,
a quick fix is available to automatically add the return keyword.
示例:
fun example(): Int {
val x = 10
x // Warning: Expression is unused
}
在应用快速修复后:
fun example(): Int {
val x = 10
return x
}