void (final @NotNull PyYieldExpression node) { final ScopeOwner owner = ScopeUtil.getScopeOwner(node); if (!(owner instanceof PyFunction || owner instanceof PyLambdaExpression)) { getHolder().newAnnotation(HighlightSeverity.ERROR, PyPsiBundle.message("ANN.yield.outside.of.function")).create(); } if (node.isDelegating() && owner instanceof PyFunction function) { if (function.isAsync() && function.isAsyncAllowed()) { getHolder().newAnnotation(HighlightSeverity.ERROR, PyPsiBundle.message("ANN.python.does.not.support.yield.from.inside.async.functions")).create(); } } }