void (@NotNull PyAnnotation node) { // Unless there is a type parameter list, return type and parameter annotations for functions are evaluated in their enclosing scope // and processed in visitPyFunction. // If there are type parameters, though, we need to put the corresponding instructions *inside* the function's scope to be able to // access them from annotations. PyFunction function = PsiTreeUtil.getParentOfType(node, PyFunction.class, true, PyStatement.class); if (function == null || function.getTypeParameterList() != null) { super.visitPyAnnotation(node); } }