Skip to content

Commit 7ddd258

Browse files
committed
XXX debug
1 parent 14a53a8 commit 7ddd258

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

crates/ty_python_semantic/src/types/call/bind.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ impl<'db> Bindings<'db> {
589589

590590
Some(KnownFunction::IsSubtypeOf) => {
591591
if let [Some(ty_a), Some(ty_b)] = overload.parameter_types() {
592+
let x = ty_a.when_subtype_of::<ConstraintSet>(db, *ty_b);
593+
eprintln!("==> {}", x.display(db));
592594
overload.set_return_type(Type::BooleanLiteral(
593595
ty_a.is_subtype_of(db, *ty_b),
594596
));

crates/ty_python_semantic/src/types/constraints.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,17 @@ impl<'db> Constraints<'db> for ConstraintSet<'db> {
339339
}
340340
result
341341
}
342+
343+
// XXX
344+
fn implies(self, db: &'db dyn Db, other: impl FnOnce() -> Self) -> Self {
345+
let q = other();
346+
eprintln!("==> {} implies {}", self.display(db), q.display(db));
347+
eprintln!(
348+
"==> p ∧ q {}",
349+
self.clone().and(db, || q.clone()).display(db)
350+
);
351+
self.clone().negate(db).or(db, || self.and(db, || q))
352+
}
342353
}
343354

344355
/// The intersection of a list of atomic constraints.
@@ -688,6 +699,7 @@ impl<'db> AtomicConstraint<'db> {
688699
/// `self` and `other` is `self`.
689700
fn subsumes(self, db: &'db dyn Db, other: Self) -> bool {
690701
debug_assert!(self.typevar == other.typevar);
702+
eprintln!("==> subsumes? {} {}", self.display(db), other.display(db));
691703
self.intersect(db, other) == Simplified::One(self)
692704
}
693705

0 commit comments

Comments
 (0)