Revert "[ty] Use invalid-assignment error code for invalid assignments to ClassVars" (#20158)

Reverts astral-sh/ruff#20156. As @sharkdp noted in his post-merge
review, there were several issues with that PR that I didn't spot before
merging — but I'm out for four days now, and would rather not leave
things in an inconsistent state for that long. I'll revisit this on
Wednesday.
This commit is contained in:
Alex Waygood 2025-08-29 19:48:45 +01:00 committed by GitHub
parent 8eb8d25565
commit 0bf5d2a204
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 15 additions and 15 deletions

View file

@ -4195,7 +4195,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
meta_attr @ PlaceAndQualifiers { .. } if meta_attr.is_class_var() => {
if emit_diagnostics {
if let Some(builder) =
self.context.report_lint(&INVALID_ASSIGNMENT, target)
self.context.report_lint(&INVALID_ATTRIBUTE_ACCESS, target)
{
builder.into_diagnostic(format_args!(
"Cannot assign to ClassVar `{attribute}` \