private GrVariable replaceOnlyExpression(@NotNull GrExpression expr,
GrExpression selectedExpr,
@NotNull PsiElement context,
@NotNull GrVariableDeclaration definition) throws IncorrectOperationException {
if (context.equals(expr.getParent()) &&
<BUG>!GroovyRefactoringUtil.isLoopOrForkStatement(context)) {
definition = (GrVariableDeclaration) expr.replaceWithStatement(definition);
if (expr.equals(selectedExpr)) {</BUG>
refreshPositionMarker(definition);
}

private GrVariable replaceOnlyExpression(@NotNull GrExpression expr,
GrExpression selectedExpr,
@NotNull PsiElement context,
@NotNull GrVariableDeclaration definition) throws IncorrectOperationException {
if (context.equals(expr.getParent()) &&
!(context instanceof GrLoopStatement) && !(context instanceof GrClosableBlock)) {
definition = expr.replaceWithStatement(definition);
if (expr.equals(selectedExpr)) {
refreshPositionMarker(definition);
}
