else
when
简化表达式快速修复可用于自动修正代码。
示例:
fun redundant() { val x = when { // <== 冗余,快速修复会将 when 表达式简化为 "val x = 1" else -> 1 } }