mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
Previously, PyTypingTypeProvider.getReferenceType returned a type from a class attribute
type hint only for assignment to instance attribute located inside a class definition.
In other words, here we inferred the expected type from the annotation
and reported incompatible types in assignment:
```python
class C:
attr: int
def m(self):
self.attr = "foo"
```
but in the following we didn't:
```python
class C:
attr: int
inst = C()
inst.attr = "foo"
```
Now we try to resolve any qualified target expression to a class
or instance attribute and then infer the type from the corresponding
annotation.
(cherry picked from commit 086dbb678a8cd89cfe332bf801631568fb6c3a4d)
IJ-MR-147382
GitOrigin-RevId: 4e3f71baa598d4caf684d0aeab23d1a9a688b94d