ruff
2dbca637 - [ty] Avoid ever-growing default types (#20991)

Commit
343 days ago
[ty] Avoid ever-growing default types (#20991) ## Summary We currently panic in the seemingly rare case where the type of a default value of a parameter depends on the callable itself: ```py class C: def f(self: C): self.x = lambda a=self.x: a ``` Types of default values are only used for display reasons, and it's unclear if we even want to track them (or if we should rather track the actual value). So it didn't seem to me that we should spend a lot of effort (and runtime) trying to achieve a theoretically correct type here (which would be infinite). Instead, we simply replace *nested* default types with `Unknown`, i.e. only if the type of the default value is a callable itself. closes https://github.com/astral-sh/ty/issues/1402 ## Test Plan Regression tests
Author
Parents
Loading