getAllReturnExpressions function
Returns all return expressions of a function body.
Implementation
List<Expression?> getAllReturnExpressions(FunctionBody body) {
return switch (body) {
BlockFunctionBody(:final block) => _ReturnExpressionGatherer.gather(block),
ExpressionFunctionBody(:final expression) => [expression],
EmptyFunctionBody() || NativeFunctionBody() => const [],
};
}