File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
typed-racket-lib/typed-racket Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 578578 #f
579579 ;; constrain v to be below T (but don't mention bounds)
580580 (eprintf "hi...........~a ~n " v)
581- (if (subtype (hash-ref (context-type-bounds context) v) T obj)
582- (singleton -Bottom v (var-demote T (context-bounds context)))
581+ (define maybe-type-bound (hash-ref (context-type-bounds context) v #f ))
582+ (if (and maybe-type-bound (subtype maybe-type-bound T obj))
583+ (singleton maybe-type-bound v (var-demote T (context-bounds context)))
583584 #f )]
584585
585586 [(S (F: (? (inferable-var? context) v)))
588589 [(F: v*) (and (bound-index? v*) (not (bound-tvar? v*)))]
589590 [_ #f ])
590591 #f
591- (eprintf "bye...........~a ~a <: ~a ~n " v S (hash-ref (context-type-bounds context) v))
592+ (define maybe-type-bound (hash-ref (context-type-bounds context) v #f ))
593+ (eprintf "bye...........~a ~a <: ~a ~n " v S maybe-type-bound)
592594 ;; constrain v to be above S (but don't mention bounds)
593- (if (subtype S (hash-ref (context- type-bounds context) v) obj)
594- (singleton (var-promote S (context-bounds context)) v (hash-ref (context- type-bounds context) v) )
595+ (if (and maybe-type-bound ( subtype S maybe- type-bound obj) )
596+ (singleton (var-promote S (context-bounds context)) v maybe- type-bound )
595597 #f )]
596598
597599 ;; recursive names should get resolved as they're seen
Original file line number Diff line number Diff line change 714714 [(? Base?) (Base-name type)]
715715 [(Pair: l r) `(Pairof ,(t->s l) ,(t->s r))]
716716 [(ListDots: dty dbound) `(List ,(t->s dty) ... ,dbound)]
717- [(F: nm)
717+ [(F: nm bound )
718718 (cond
719719 [(eq? nm imp-var) "Imp " ]
720720 [(eq? nm self-var) "Self " ]
721+ [(Type? bound) (format "~a <: ~a " nm (t->s bound))]
721722 [else nm])]
722723 [(Param: in out)
723724 (if (equal? in out)
You can’t perform that action at this time.
0 commit comments