void (@NotNull PyComprehensionElement node) { super.visitPyComprehensionElement(node); if (registerForLanguageLevel(LanguageLevel.PYTHON35) && myVersionsToProcess.contains(LanguageLevel.PYTHON35)) { Arrays .stream(node.getNode().getChildren(TokenSet.create(PyTokenTypes.ASYNC_KEYWORD))) .filter(Objects::nonNull) .map(ASTNode::getPsi) .forEach(element -> registerProblem(element, PyPsiBundle.message("INSP.compatibility.py35.does.not.support.async.inside.comprehensions.and.generator.expressions"))); final Stream<PyPrefixExpression> resultPrefixExpressions = PsiTreeUtil .collectElementsOfType(node.getResultExpression(), PyPrefixExpression.class) .stream(); final Stream<PyPrefixExpression> ifComponentsPrefixExpressions = node.getIfComponents() .stream() .map(ifComponent -> PsiTreeUtil.collectElementsOfType(ifComponent.getTest(), PyPrefixExpression.class)) .flatMap(Collection::stream); Stream.concat(resultPrefixExpressions, ifComponentsPrefixExpressions) .filter(expression -> expression.getOperator() == PyTokenTypes.AWAIT_KEYWORD && expression.getOperand() != null) .map(expression -> expression.getNode().findChildByType(PyTokenTypes.AWAIT_KEYWORD)) .filter(Objects::nonNull) .map(ASTNode::getPsi) .forEach(element -> registerProblem(element, PyPsiBundle.message("INSP.compatibility.py35.does.not.support.await.inside.comprehensions"))); } }