ruff
a0939fd9 - [ty] route constructor calls through bindings (#22124)

Commit
83 days ago
[ty] route constructor calls through bindings (#22124) ## Summary fixes https://github.com/astral-sh/ty/issues/2124 * route constructor calls through the existing `Type::bindings` machinery via `constructor_bindings()`, ensuring constructor return types are instance-typed (not `__init__`'s `None`) * delete the legacy constructor call path * constructor overload resolution is deterministic (first matching overload), and implicit `__new__`/`__init__` lints remain method-specific and fire once per call site (including the missing-`__init__` fallback) ## Test Plan * mdtest (constructor): added coverage for `@staticmethod __new__`, conflicting `__new__`/`__init__` parameter types, `__new__`-only fallback (object `__init__` accepts args), and generic constructor inference. * mdtest (decorators): `functools.cached_property` specifically added to address https://github.com/astral-sh/ty/issues/1446 * mdtest (classes): fixed the TODOs for generic class params `C[Unknown]` are now correctly revealed as `C[int]` (and constructor specialization uses first matching overload) * mdtest (functions): improved constructor path now correctly surfaces both the ill-typed generic call and the resulting invalid assignment --------- Co-authored-by: Carl Meyer <carl@astral.sh>
Author
Parents
Loading