Skip to content

Commit 7d88b7a

Browse files
committed
Remove special case of subtype in tc-apply.
1 parent 7e45bc7 commit 7d88b7a

File tree

1 file changed

+13
-20
lines changed
  • pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck

1 file changed

+13
-20
lines changed

pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-apply.rkt

+13-20
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,19 @@
6565
(define (finish substitution)
6666
(and substitution (do-ret (subst-all substitution range))))
6767

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)))
8881
(failure))]
8982
[(tc-result1: (PolyDots: (and vars (list fixed-vars ... dotted-var))
9083
(Function: (list (arr: doms rngs rests drests (list (Keyword: _ _ #f) ...)) ..1))))

0 commit comments

Comments
 (0)