mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 07:34:06 -05:00
[ty] Short circuit ReachabilityConstraints::analyze_single for dynamic types (#19867)
This commit is contained in:
@@ -505,3 +505,16 @@ class Abstract(Protocol):
|
||||
class Concrete(Abstract):
|
||||
def method(self) -> str: ... # error: [invalid-return-type]
|
||||
```
|
||||
|
||||
## Diagnostics for `invalid-return-type` on dynamic type
|
||||
|
||||
```toml
|
||||
environment.python-version = "3.12"
|
||||
```
|
||||
|
||||
```py
|
||||
from typing import Never, Any
|
||||
|
||||
def f(func: Any) -> Never: # error: [invalid-return-type]
|
||||
func()
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user