diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UseExpressionBodyInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UseExpressionBodyInspection.kt index b9f921a7893..3de65eda89b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UseExpressionBodyInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UseExpressionBodyInspection.kt @@ -60,7 +60,7 @@ class UseExpressionBodyInspection(private val convertEmptyToUnit: Boolean) : Abs val toHighlight = valueStatement.toHighlight() return when { valueStatement !is KtReturnExpression -> Status(toHighlight, "block body", INFORMATION) - valueStatement.returnedExpression is KtWhenExpression -> Status(toHighlight, "'return when'", GENERIC_ERROR_OR_WARNING) + valueStatement.returnedExpression is KtWhenExpression -> Status(toHighlight, "'return when'", INFORMATION) valueStatement.isOneLiner() -> Status(toHighlight, "one-line return", GENERIC_ERROR_OR_WARNING) else -> Status(toHighlight, "return", INFORMATION) } diff --git a/idea/testData/inspectionsLocal/useExpressionBody/when.kt b/idea/testData/inspectionsLocal/useExpressionBody/when.kt index 27f513a8ee5..cac4ddb8fc0 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/when.kt +++ b/idea/testData/inspectionsLocal/useExpressionBody/when.kt @@ -1,3 +1,5 @@ +// HIGHLIGHT: INFORMATION + fun sign(x: Int): Int { return when { x < 0 -> -1 diff --git a/idea/testData/inspectionsLocal/useExpressionBody/when.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/when.kt.after index 16630fc8f0c..bc3aa12c09d 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/when.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/when.kt.after @@ -1,3 +1,5 @@ +// HIGHLIGHT: INFORMATION + fun sign(x: Int): Int = when { x < 0 -> -1 x > 0 -> 1