Skip to content

Commit 17541f8

Browse files
committed
[ty] Do not treat tuple types as ever being single-valued
1 parent 580577e commit 17541f8

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,6 @@ impl<'db> Type<'db> {
24352435
false
24362436
}
24372437

2438-
Type::Tuple(tuple) => tuple.is_single_valued(db),
24392438
Type::NominalInstance(instance) => instance.is_single_valued(db),
24402439

24412440
Type::BoundSuper(_) => {
@@ -2446,6 +2445,7 @@ impl<'db> Type<'db> {
24462445
Type::TypeIs(type_is) => type_is.is_bound(db),
24472446

24482447
Type::Dynamic(_)
2448+
| Type::Tuple(..)
24492449
| Type::Never
24502450
| Type::Union(..)
24512451
| Type::Intersection(..)

crates/ty_python_semantic/src/types/tuple.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ impl<'db> TupleType<'db> {
280280
.is_disjoint_from_impl(db, other.tuple(db), visitor)
281281
}
282282

283-
pub(crate) fn is_single_valued(self, db: &'db dyn Db) -> bool {
284-
self.tuple(db).is_single_valued(db)
285-
}
286-
287283
pub(crate) fn truthiness(self, db: &'db dyn Db) -> Truthiness {
288284
self.tuple(db).truthiness()
289285
}
@@ -469,10 +465,6 @@ impl<'db> FixedLengthTuple<Type<'db>> {
469465
.zip(&other.0)
470466
.all(|(self_ty, other_ty)| self_ty.is_equivalent_to(db, *other_ty))
471467
}
472-
473-
fn is_single_valued(&self, db: &'db dyn Db) -> bool {
474-
self.0.iter().all(|ty| ty.is_single_valued(db))
475-
}
476468
}
477469

478470
#[allow(unsafe_code)]
@@ -1202,13 +1194,6 @@ impl<'db> Tuple<Type<'db>> {
12021194
// both.
12031195
false
12041196
}
1205-
1206-
fn is_single_valued(&self, db: &'db dyn Db) -> bool {
1207-
match self {
1208-
Tuple::Fixed(tuple) => tuple.is_single_valued(db),
1209-
Tuple::Variable(_) => false,
1210-
}
1211-
}
12121197
}
12131198

12141199
impl<T> From<FixedLengthTuple<T>> for Tuple<T> {

0 commit comments

Comments
 (0)