mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 08:04:26 -05:00
## Summary Closes https://github.com/astral-sh/ty/issues/502. In the following example: ```py class Foo: x: int def method(self): y = x ``` The user may intended to use `y = self.x` in `method`. This is now added as a subdiagnostic in the following form : `info: An attribute with the same name as 'x' is defined, consider using 'self.x'` ## Test Plan Added mdtest with snapshot diagnostics.
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/ty_test/README.md for documentation of this test format.