[FE 1.0] Properly report NON_TRIVIAL_BOOLEAN_CONSTANT on parenthesized expressions
^KT-39883
This commit is contained in:
committed by
teamcityserver
parent
1513e739c6
commit
f52361ac2b
+4
-1
@@ -422,7 +422,10 @@ private class ConstantExpressionEvaluatorVisitor(
|
||||
if (languageVersionSettings.supportsFeature(LanguageFeature.ProhibitSimplificationOfNonTrivialConstBooleanExpressions)) {
|
||||
return true
|
||||
} else {
|
||||
val parent = expression.parent
|
||||
var parent = expression.parent
|
||||
while (parent is KtParenthesizedExpression) {
|
||||
parent = parent.parent
|
||||
}
|
||||
if (
|
||||
parent is KtWhenConditionWithExpression ||
|
||||
parent is KtContainerNode && (parent.parent is KtWhileExpression || parent.parent is KtDoWhileExpression)
|
||||
|
||||
Reference in New Issue
Block a user