[ty] Check return type of generator functions (#24026)
## Summary
Perform return type checking for generator functions.
part of https://github.com/astral-sh/ty/issues/1718
## Test Plan
The two newly added diagnostics in ecosystem result are correct the rest
were marked as flaky. So looks good.
I updated the tests for `return_types.md`.
---------
Co-authored-by: David Peter <sharkdp@users.noreply.github.com>