You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
haven't tested it, but I think this might fix things:
diff --git a/crates/red_knot_python_semantic/src/types.rs b/crates/red_knot_python_semantic/src/types.rs
index 4f89feb57..17a43a519 100644
--- a/crates/red_knot_python_semantic/src/types.rs+++ b/crates/red_knot_python_semantic/src/types.rs@@ -1071,9 +1071,12 @@ impl<'db> Type<'db> {
// This special case is required because the left-hand side tuple might be a
// gradual type, so we can not rely on subtyping. This allows us to assign e.g.
// `tuple[Any, int]` to `tuple`.
- (Type::Tuple(_), _) => KnownClass::Tuple- .to_instance(db)- .is_assignable_to(db, target),+ (Type::Tuple(_), _) => {+ self.is_subtype_of(db, target)+ || KnownClass::Tuple+ .to_instance(db)+ .is_assignable_to(db, target)+ }
// `type[Any]` is assignable to any `type[...]` type, because `type[Any]` can
// materialize to any `type[...]` type.
though there may also be a more elegant or more efficient solution.
AlexWaygood
changed the title
Daily property test run failed on Fri Apr 04 2025
[red-knot] is_subtype_of no longer implies is_assignable_to for all Type::Tuple types
Apr 4, 2025
Failing property-test run listed here: https://github.com/astral-sh/ruff/actions/runs/14265011645
The text was updated successfully, but these errors were encountered: