From fddc95633398b3c9a67fe6fd23afbd322edf3712 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 8 May 2014 08:44:54 -0700 Subject: [PATCH] Add comments to tc/apply. original commit: 6967ec7954c4b2e8c090e4c9ec37171e20a6e726 --- .../typed-racket-lib/typed-racket/typecheck/tc-apply.rkt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-apply.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-apply.rkt index 4907c495..5b8f6258 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-apply.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-apply.rkt @@ -42,6 +42,7 @@ (values tail-ty tail-bound)] [t (values #f #f)])) + ;; Raises an error message for the case that the arguments do not match any of the domains (define (failure) (match f-ty [(tc-result1: @@ -60,8 +61,14 @@ [range (in-list rngs)] [rest (in-list rests)] [drest (in-list drests)]) + ;; Takes a possible substitution and comuptes the substituted range type if it is not #f (define (finish substitution) (and substitution (do-ret (subst-all substitution range)))) + + ;; Figures out if there is a possible substitution of vars and if there is uses that + ;; substitution to compute the actual range type. + ;; Currently if vars is null, then we use subtype instead because inference is missing some + ;; cases that are covered by subtype. (define (local-infer s t) (if (empty? vars) (and (subtype s t) (do-ret range))