void (@NotNull GrReturnStatement returnStatement) { super.visitReturnStatement(returnStatement); final GrExpression returnValue = returnStatement.getReturnValue(); if (returnValue == null) { return; } final GrClosableBlock closure = PsiTreeUtil.getParentOfType(returnStatement, GrClosableBlock.class); if (closure == null) { return; } final GrMethod containingMethod = PsiTreeUtil.getParentOfType(returnStatement, GrMethod.class); if (containingMethod != null && PsiTreeUtil.isAncestor(closure, containingMethod, true)) { return; } if (!ControlFlowUtils.closureCompletesWithStatement(closure, returnStatement)) { return; } registerStatementError(returnStatement); }