void (@NotNull PyYieldExpression node) { super.visitPyYieldExpression(node); Optional .ofNullable(ScopeUtil.getScopeOwner(node)) .map(owner -> PyUtil.as(owner, PyFunction.class)) .filter(function -> function.isAsync() && function.isAsyncAllowed()) .ifPresent( function -> { if (!node.isDelegating() && registerForLanguageLevel(LanguageLevel.PYTHON35) && myVersionsToProcess.contains(LanguageLevel.PYTHON35)) { registerProblem(node, PyPsiBundle.message("INSP.compatibility.py35.does.not.support.yield.inside.async.functions")); } } ); if (!node.isDelegating()) { return; } registerForAllMatchingVersions(level -> level.isPython2() && registerForLanguageLevel(level), PyPsiBundle.message("INSP.compatibility.feature.support.yield.from"), node); }