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 623
623
(let ([s (resolve-once s)])
624
624
(and s (cg s t obj)))]
625
625
626
+ [((F: var (? Type? bound)) t)
627
+ (let ([s (resolve-once bound)])
628
+ (and s (cg s t obj)))]
629
+
626
630
;; constrain b1 to be below T, but don't mention the new vars
627
631
[((Poly: v1 b1) T) (cgen (context-add context #:bounds v1) b1 T)]
628
632
Original file line number Diff line number Diff line change 1691
1691
(int-err "Wrong number of names: expected ~a got ~a " n (length names)))
1692
1692
(instantiate-type body
1693
1693
(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))
1695
1700
names))]))
1696
1701
1697
1702
;; PolyDots 'smart' constructor
Original file line number Diff line number Diff line change 17
17
(number->string a))
18
18
19
19
(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