Skip to content

Commit

Permalink
Update expected diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Oct 30, 2024
1 parent 0175a1b commit 3803094
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions crates/red_knot_python_semantic/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2220,8 +2220,7 @@ mod tests {
"
class A: ...
class B: ...
def flag() -> bool: ...
U = A if flag() else B
U = A if flag else B
",
)
.unwrap();
Expand Down
6 changes: 2 additions & 4 deletions crates/red_knot_python_semantic/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2608,8 +2608,6 @@ impl<'db> TypeInferenceBuilder<'db> {
}
};

let db = self.db;

if let SymbolLookupResult::Bound(class_member, _) =
class.class_member(self.db, unary_dunder_method)
{
Expand All @@ -2623,7 +2621,7 @@ impl<'db> TypeInferenceBuilder<'db> {
"unsupported-operator",
format_args!(
"Unary operator `{op}` is unsupported for type `{}`",
operand_type.display(db),
operand_type.display(self.db),
),
);
e.return_ty()
Expand All @@ -2635,7 +2633,7 @@ impl<'db> TypeInferenceBuilder<'db> {
"unsupported-operator",
format_args!(
"Unary operator `{op}` is unsupported for type `{}`",
operand_type.display(db),
operand_type.display(self.db),
),
);

Expand Down
2 changes: 0 additions & 2 deletions crates/ruff_benchmark/benches/red_knot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ static EXPECTED_DIAGNOSTICS: &[&str] = &[
"/src/tomllib/_parser.py:267:9: Conflicting declared types for `char`: Unknown, str | None",
"/src/tomllib/_parser.py:348:20: Name `nest` used when possibly not defined",
"/src/tomllib/_parser.py:353:5: Name `nest` used when possibly not defined",
"/src/tomllib/_parser.py:353:5: Method `__getitem__` of type `Unbound | @Todo` is not callable on object of type `Unbound | @Todo`",
"/src/tomllib/_parser.py:364:9: Conflicting declared types for `char`: Unknown, str | None",
"/src/tomllib/_parser.py:381:13: Conflicting declared types for `char`: Unknown, str | None",
"/src/tomllib/_parser.py:395:9: Conflicting declared types for `char`: Unknown, str | None",
"/src/tomllib/_parser.py:453:24: Name `nest` used when possibly not defined",
"/src/tomllib/_parser.py:455:9: Name `nest` used when possibly not defined",
"/src/tomllib/_parser.py:455:9: Method `__getitem__` of type `Unbound | @Todo` is not callable on object of type `Unbound | @Todo`",
"/src/tomllib/_parser.py:482:16: Name `char` used when possibly not defined",
"/src/tomllib/_parser.py:566:12: Name `char` used when possibly not defined",
"/src/tomllib/_parser.py:573:12: Name `char` used when possibly not defined",
Expand Down

0 comments on commit 3803094

Please sign in to comment.