Back to Intellij Community

SimplifyBooleanWithConstants

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/SimplifyBooleanWithConstants.html

2025.3-rc-2290 B
Original Source

Reports boolean expression parts that can be reduced to constants.

The quick-fix simplifies the condition.

Example:

fun use(arg: Boolean) {
      if (false == arg) {

      }
  }

After the quick-fix is applied:

fun use(arg: Boolean) {
      if (!arg) {

      }
  }