ruff/crates/ty_python_semantic/resources/mdtest/diagnostics
David Peter 5ca9c15fc8
[ty] Better invalid-assignment diagnostics (#21476)
## Summary

Improve the diagnostic range for `invalid-assignment` diagnostics, and
add source annotations for the value and target type.

closes https://github.com/astral-sh/ty/issues/1556

### Before

<img width="836" height="601" alt="image"
src="https://github.com/user-attachments/assets/a48219bb-58a8-4a83-b290-d09ef50ce5f0"
/>

### After

<img width="857" height="742" alt="image"
src="https://github.com/user-attachments/assets/cfcaa4f4-94fb-459e-8d64-97050dfecb50"
/>

## Ecosystem impact

Very good! Due to the wider diagnostic range, we now pick up more `#
type: ignore` directives that were supposed to suppress an invalid
assignment diagnostic.

## Test Plan

New snapshot tests
2025-11-18 14:31:04 +01:00
..
attribute_assignment.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
invalid_argument_type.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
invalid_assignment.md [ty] Better invalid-assignment diagnostics (#21476) 2025-11-18 14:31:04 +01:00
invalid_await.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
legacy_typevars.md [ty] defer inference of legacy TypeVar bound/constraints/defaults (#20598) 2025-10-09 21:08:37 +00:00
missing_argument.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
no_matching_overload.md [ty] Improve invalid method calls for unmatched overloads (#18122) 2025-05-15 11:39:14 -04:00
same_names.md [ty] Improve assignability/subtyping between two protocol types (#20368) 2025-10-08 18:37:30 +00:00
semantic_syntax_errors.md [ty] name is parameter and global is a syntax error (#21312) 2025-11-14 18:15:34 +00:00
shadowing.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
single_matching_overload.md [ty] Surface matched overload diagnostic directly (#18452) 2025-06-20 08:36:49 +05:30
too_many_positionals.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
union_call.md [ty] Truncate Literal type display in some situations (#20928) 2025-10-17 11:50:58 +00:00
unknown_argument.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
unpacking.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unresolved_import.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unresolved_reference.md [ty] Add a note to the diagnostic if a new builtin is used on an old Python version (#18068) 2025-05-13 10:08:04 -04:00
unsupported_bool_conversion.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
version_related_syntax_errors.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00