|
65 | 65 | (define (finish substitution)
|
66 | 66 | (and substitution (do-ret (subst-all substitution range))))
|
67 | 67 |
|
68 |
| - ;; Figures out if there is a possible substitution of vars and if there is uses that |
69 |
| - ;; substitution to compute the actual range type. |
70 |
| - ;; Currently if vars is null, then we use subtype instead because inference is missing some |
71 |
| - ;; cases that are covered by subtype. |
72 |
| - (define (local-infer s t) |
73 |
| - (if (empty? vars) |
74 |
| - (and (subtype s t) (do-ret range)) |
75 |
| - (finish (infer vars null (list s) (list t) range)))) |
76 |
| - |
77 |
| - (local-infer |
78 |
| - (-Tuple* arg-tys full-tail-ty) |
79 |
| - (-Tuple* domain |
80 |
| - (cond |
81 |
| - ;; the actual work, when we have a * function |
82 |
| - [rest (make-Listof rest)] |
83 |
| - ;; ... function |
84 |
| - [drest (make-ListDots (car drest) (cdr drest))] |
85 |
| - ;; the function has no rest argument, |
86 |
| - ;; but provides all the necessary fixed arguments |
87 |
| - [else -Null])))) |
| 68 | + (finish |
| 69 | + (infer vars null |
| 70 | + (list (-Tuple* arg-tys full-tail-ty)) |
| 71 | + (list (-Tuple* domain |
| 72 | + (cond |
| 73 | + ;; the actual work, when we have a * function |
| 74 | + [rest (make-Listof rest)] |
| 75 | + ;; ... function |
| 76 | + [drest (make-ListDots (car drest) (cdr drest))] |
| 77 | + ;; the function has no rest argument, |
| 78 | + ;; but provides all the necessary fixed arguments |
| 79 | + [else -Null]))) |
| 80 | + range))) |
88 | 81 | (failure))]
|
89 | 82 | [(tc-result1: (PolyDots: (and vars (list fixed-vars ... dotted-var))
|
90 | 83 | (Function: (list (arr: doms rngs rests drests (list (Keyword: _ _ #f) ...)) ..1))))
|
|
0 commit comments