ruff/crates/ty_python_semantic/resources/mdtest/function
Matthew Mckee cbe94b094b
[ty] Support empty function bodies in if TYPE_CHECKING blocks (#19372)
## Summary

Resolves https://github.com/astral-sh/ty/issues/339

Supports having a blank function body inside `if TYPE_CHECKING` block or
in the elif or else of a `if not TYPE_CHECKING` block.

```py
if TYPE_CHECKING:
    def foo() -> int: ...

if not TYPE_CHECKING: ...
else:     
    def bar() -> int: ...
```

## Test Plan

Update `function/return_type.md`

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2025-07-16 14:48:04 -06:00
..
parameters.md [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
return_type.md [ty] Support empty function bodies in if TYPE_CHECKING blocks (#19372) 2025-07-16 14:48:04 -06:00