File tree Expand file tree Collapse file tree 2 files changed +24
-15
lines changed
typed-racket-lib/typed-racket Expand file tree Collapse file tree 2 files changed +24
-15
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 (define maybe-type-bound (hash-ref (context-type-bounds context) v #f ))
581- (if (and maybe-type-bound (subtype maybe-type-bound T obj))
582- (singleton maybe-type-bound v (var-demote T (context-bounds context)))
583- #f )]
581+ (if maybe-type-bound
582+ (if (subtype maybe-type-bound T obj)
583+ (singleton maybe-type-bound
584+ v
585+ (var-demote T (context-bounds context)))
586+ #f )
587+ (singleton -Bottom
588+ v
589+ (var-demote T (context-bounds context))))]
584590
585591 [(S (F: (? (inferable-var? context) v)))
586592 #:return-when
590596 #f
591597 (define maybe-type-bound (hash-ref (context-type-bounds context) v #f ))
592598 ;; constrain v to be above S (but don't mention bounds)
593- (if (and maybe-type-bound (subtype S maybe-type-bound obj))
594- (singleton (var-promote S (context-bounds context)) v maybe-type-bound)
595- #f )]
599+ (if maybe-type-bound
600+ (if (subtype S maybe-type-bound obj)
601+ (singleton (var-demote S (context-bounds context))
602+ v
603+ maybe-type-bound)
604+ #f )
605+ (singleton (var-demote S (context-bounds context))
606+ v
607+ Univ))]
596608
597609 ;; recursive names should get resolved as they're seen
598610 [(s (? Name? t))
10101022 (let ()
10111023 (define/cond-contract (infer X Y S T R [expected #f ]
10121024 #:multiple? [multiple-substitutions? #f ]
1013- #:bounds [bounds '#()]
1025+ #:bounds [bounds '#hash ()]
10141026 #:objs [objs '() ])
10151027 (((listof symbol?) (listof symbol?) (listof Type?) (listof Type?)
10161028 (or/c #f Values/c AnyValues? ValuesDots?))
Original file line number Diff line number Diff line change 14991499 (make-PolyRow constraints (rec/lvl body (add1 lvl)))]
15001500 [(PolyDots: n body)
15011501 (make-PolyDots n (rec/lvl body (+ n lvl)))]
1502- [(Poly: n bound body)
1503- (make-Poly n (rec/lvl body (+ n lvl)))]
1502+ [(Poly: n bounds body)
1503+ (make-Poly n bounds (rec/lvl body (+ n lvl)))]
15041504 [_ (Rep-fmap cur rec)])))
15051505
15061506
16781678 (values (list-ref names idx) v)))
16791679 (unless (= (length names) n)
16801680 (int-err "Wrong number of names: expected ~a got ~a " n (length names)))
1681- (eprintf "new bounds is ~a ~n " new-bounds)
16821681 (instantiate-type body
16831682 (map (lambda (n)
16841683 (make-F n (hash-ref new-bounds n #f )))
1685- names)
1686- #;
1687- (map F* names))]))
1684+ names))]))
16881685
16891686;; PolyDots 'smart' constructor
16901687(define (PolyDots* names body)
17171714(define (PolyRow-body* names t)
17181715 (match t
17191716 [(PolyRow: constraints body)
1720- (instantiate-type body (map names))]))
1717+ (instantiate-type body (map F* names))]))
17211718
17221719
17231720;;***************************************************************
19821979 [(Some: n body)
19831980 (unless (= (length names) n)
19841981 (int-err "Wrong number of names: expected ~a got ~a " n (length names)))
1985- (instantiate-type body (map names))]))
1982+ (instantiate-type body (map F* names))]))
19861983
19871984
19881985(define-match-expander Some-names:
You can’t perform that action at this time.
0 commit comments