From c469a4d9b96f2c64983736328a7315344b2fb42d Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 9 May 2018 02:41:01 +0300 Subject: [PATCH] Bad condition for cast in KotlinStatementsSurrounder (EA-119701) --- .../surroundWith/statement/KotlinStatementsSurrounder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinStatementsSurrounder.java b/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinStatementsSurrounder.java index dc096be0abe..943aa487326 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinStatementsSurrounder.java +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinStatementsSurrounder.java @@ -35,7 +35,7 @@ public abstract class KotlinStatementsSurrounder implements Surrounder { return false; } - if (elements.length == 1 || elements[0] instanceof KtExpression) { + if (elements.length == 1 && elements[0] instanceof KtExpression) { if (!isApplicableWhenUsedAsExpression() && KotlinSurrounderUtils.isUsedAsExpression((KtExpression) elements[0])) { return false; }