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 578
578
#f
579
579
;; constrain v to be below T (but don't mention bounds)
580
580
(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)))
583
584
#f )]
584
585
585
586
[(S (F: (? (inferable-var? context) v)))
588
589
[(F: v*) (and (bound-index? v*) (not (bound-tvar? v*)))]
589
590
[_ #f ])
590
591
#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)
592
594
;; 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 )
595
597
#f )]
596
598
597
599
;; recursive names should get resolved as they're seen
Original file line number Diff line number Diff line change 714
714
[(? Base?) (Base-name type)]
715
715
[(Pair: l r) `(Pairof ,(t->s l) ,(t->s r))]
716
716
[(ListDots: dty dbound) `(List ,(t->s dty) ... ,dbound)]
717
- [(F: nm)
717
+ [(F: nm bound )
718
718
(cond
719
719
[(eq? nm imp-var) "Imp " ]
720
720
[(eq? nm self-var) "Self " ]
721
+ [(Type? bound) (format "~a <: ~a " nm (t->s bound))]
721
722
[else nm])]
722
723
[(Param: in out)
723
724
(if (equal? in out)
You can’t perform that action at this time.
0 commit comments