void (@NotNull PyCallable callable, @NotNull PsiElement beingChecked, boolean allowed, @NotNull @InspectionMessage String message) { if (callable instanceof PyFunction function) { if (PyKnownDecoratorUtil.hasAbstractDecorator(function, myTypeEvalContext)) { return; } if (allowed && !someFlowHasExitPoint(function, Visitor::isAllowedExitPoint) || !allowed && someFlowHasExitPoint(function, Visitor::isDisallowedExitPoint)) { registerProblem(beingChecked, message); } } else { final PyType type = myTypeEvalContext.getReturnType(callable); final boolean hasReturns = !(type instanceof PyNoneType); if (allowed ^ hasReturns) { registerProblem(beingChecked, message); } } }