Add test case for walrus operators in return types (#6438)

## Summary

Closes https://github.com/astral-sh/ruff/issues/6437.

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2023-08-11 14:28:48 -04:00 committed by GitHub
parent 53246b725e
commit e91caea490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -49,6 +49,7 @@ impl NeedsParentheses for ExprNamedExpr {
|| parent.is_expr_await()
|| parent.is_stmt_delete()
|| parent.is_stmt_for()
|| parent.is_stmt_function_def()
{
OptionalParentheses::Always
} else {