File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
crates/ty_python_semantic/src/types Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff 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 ) ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments