False positive "Function declared to return `Never` but is missing an explicit `return`"
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
```python
from typing import Never
def foo() -> Never:
print("hello")
foo()
```
Python: 3.12
We probably shouldn't give this error if the expected return is Never
### Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0A5GADcYlADrpJmGGDphcuABQBKOgFoAfIJFjEkuobrFKrBkvEgAFjChRcllZMkLlKkABoQZSrKilCBlooCgBiOgAFUl8wfzo0LDx8OgBjXHRINgBXSlQGCHTCSXCAZRgYOisGBmI4RAB6ep8-AN42eph0esxcFLh6tIyIbNz89Pr5XjpUYVRoVGxYVPTMnLyC9DpcYjH0OCL0MgYrdPVRSjgNugBeOksAZkIARgAmS0kAbTFqC4BdSSy6C4PD4MEw6kwEF8KXyohudAA5MN0LwYAjJCiGOpfABHLJQsHqADWMFI6lQKRS8Dg8IRAHdUJR0Oj0CAAL5eCmwmAAMWgMAoCRwBBI5DZQA
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.