Fix bug in assignment-to-when unfolding
This commit is contained in:
+2
-2
@@ -79,7 +79,7 @@ public class BranchedUnfoldingUtils {
|
|||||||
public static void unfoldAssignmentToWhen(@NotNull JetBinaryExpression assignment) {
|
public static void unfoldAssignmentToWhen(@NotNull JetBinaryExpression assignment) {
|
||||||
Project project = assignment.getProject();
|
Project project = assignment.getProject();
|
||||||
String op = assignment.getOperationReference().getText();
|
String op = assignment.getOperationReference().getText();
|
||||||
JetExpression lhs = (JetExpression)assignment.getLeft().copy();
|
String lhsText = assignment.getLeft().getText();
|
||||||
JetWhenExpression whenExpression = (JetWhenExpression)assignment.getRight();
|
JetWhenExpression whenExpression = (JetWhenExpression)assignment.getRight();
|
||||||
|
|
||||||
assert whenExpression != null : UNFOLD_WITHOUT_CHECK;
|
assert whenExpression != null : UNFOLD_WITHOUT_CHECK;
|
||||||
@@ -91,7 +91,7 @@ public class BranchedUnfoldingUtils {
|
|||||||
|
|
||||||
assert currExpr != null : UNFOLD_WITHOUT_CHECK;
|
assert currExpr != null : UNFOLD_WITHOUT_CHECK;
|
||||||
|
|
||||||
currExpr.replace(JetPsiFactory.createBinaryExpression(project, lhs, op, currExpr));
|
currExpr.replace(JetPsiFactory.createBinaryExpression(project, JetPsiFactory.createExpression(project, lhsText), op, currExpr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user