File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
typed-racket-lib/typed-racket
typed-racket-test/succeed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 623623 (let ([s (resolve-once s)])
624624 (and s (cg s t obj)))]
625625
626+ [((F: var (? Type? bound)) t)
627+ (let ([s (resolve-once bound)])
628+ (and s (cg s t obj)))]
629+
626630 ;; constrain b1 to be below T, but don't mention the new vars
627631 [((Poly: v1 b1) T) (cgen (context-add context #:bounds v1) b1 T)]
628632
Original file line number Diff line number Diff line change 16911691 (int-err "Wrong number of names: expected ~a got ~a " n (length names)))
16921692 (instantiate-type body
16931693 (map (lambda (n)
1694- (make-F n (hash-ref new-bounds n #f )))
1694+ (define v (match (hash-ref new-bounds n #f )
1695+ [(App: rator (list (F: vb _ )))
1696+ #:when (hash-has-key? new-bounds vb)
1697+ (make-App rator (list (hash-ref new-bounds vb)))]
1698+ [_else _else]))
1699+ (make-F n v))
16951700 names))]))
16961701
16971702;; PolyDots 'smart' constructor
Original file line number Diff line number Diff line change 1717 (number->string a))
1818
1919(c-func 10 (foo 10 ))
20+
21+ (: d-func (All ([X <: Integer] [Y <: (Foo X)])
22+ (-> X Y String)))
23+ (define (d-func a b)
24+ (number->string (foo-a b)))
25+
26+ (d-func 42 (foo 10 ))
You can’t perform that action at this time.
0 commit comments