private void checkExitPoint() { final PsiElement element = PsiTreeUtil.getParentOfType(myExpression, PsiMethod.class, GrClosableBlock.class); if (element instanceof GrMethod) { final GrMethod method = (GrMethod) element; ControlFlowUtils.visitAllExitPoints( method.getBlock(), new ControlFlowUtils.ExitPointVisitor() { @Override public boolean visitExitPoint( Instruction instruction, @Nullable GrExpression returnValue) { if (returnValue == myExpression) { final PsiType returnType = method.getReturnType(); if (returnType != null) { myResult = createSimpleSubTypeResult(returnType); } return false; } return true; } }); } }