[ty] Support implicit type of cls in signatures (#21771)
## Summary Extends https://github.com/astral-sh/ruff/pull/20517 to support the implicit type of `cls` in `@classmethod` signatures. Part of https://github.com/astral-sh/ty/issues/159.
This commit is contained in:
@@ -271,8 +271,7 @@ reveal_type(Person._make) # revealed: bound method <class 'Person'>._make(itera
|
||||
reveal_type(Person._asdict) # revealed: def _asdict(self) -> dict[str, Any]
|
||||
reveal_type(Person._replace) # revealed: def _replace(self, **kwargs: Any) -> Self@_replace
|
||||
|
||||
# TODO: should be `Person` once we support implicit type of `self`
|
||||
reveal_type(Person._make(("Alice", 42))) # revealed: Unknown
|
||||
reveal_type(Person._make(("Alice", 42))) # revealed: Person
|
||||
|
||||
person = Person("Alice", 42)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user