ruff
708a9526 - [ty] Highlight declarations in invalid-assignment diagnostics (#27872)

Commit
19 days ago
[ty] Highlight declarations in invalid-assignment diagnostics (#27872) ## Summary When an `invalid-assignment` diagnostic is caused by a previously declared type, point directly to the annotation that established that type instead of only annotating the assignment target. ## Example ```py value: int value = "three" ``` ```text error[invalid-assignment]: Object of type `Literal["three"]` is not assignable to `int` --> example.py:2:9 | 1 | value: int | --- Declared type 2 | value = "three" | ^^^^^^^ Incompatible value of type `Literal["three"]` ```
Author
Parents
Loading