We narrow in the first case below but not the second (playground):
def maybe_int() -> int | None:
return 1
def _():
x = maybe_int()
if x is not None:
reveal_type(x)
if (y := maybe_int()) is not None:
reveal_type(y)
Anywhere we would narrow on a test against a Name, we should narrow in the same way if that name is the target of an assignment expression in the same test.