mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Revert "[ty] Use invalid-assignment
error code for invalid assignments to ClassVar
s" (#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:
parent
8eb8d25565
commit
0bf5d2a204
6 changed files with 15 additions and 15 deletions
|
@ -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}` \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue