diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/subtype.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/subtype.rkt index a6193143..210eb9e2 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/subtype.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/subtype.rkt @@ -70,29 +70,29 @@ ;; -> (Option (Listof (Pairof Num Num))) ;; ;; Given function types F_s and F_t, this procedure is called to check that the -;; keyword types t-kws for F_t are subtypes of the keyword types s-kws for F_s +;; keyword types s-kws for F_s are subtypes of the keyword types t-kws for F_t ;; when checking that F_s <: F_t (but *not* F_t <: F_s). ;; ;; Note that in terms of width, s-kws may have more keywords (i.e., F_s accepts ;; all keywords that F_t does) but the types in s-kws must be supertypes of those ;; in t-kws (i.e., F_s domain types are at least as permissive as those of F_t). -(define (kw-subtypes* A0 t-kws s-kws) - (let loop ([A A0] [t t-kws] [s s-kws]) +(define (kw-subtypes* A0 s-kws t-kws) + (let loop ([A A0] [s s-kws] [t t-kws]) (and A - (match* (t s) - [((cons (Keyword: kt tt rt) rest-t) (cons (Keyword: ks ts rs) rest-s)) + (match* (s t) + [((cons (Keyword: ks ts rs) rest-s) (cons (Keyword: kt tt rt) rest-t)) (cond [(eq? kt ks) (and ;; if t is optional, s must be as well (or rt (not rs)) - (loop (subtype* A tt ts) rest-t rest-s))] + (loop (subtype* A tt ts) rest-s rest-t))] ;; optional extra keywords in s are ok ;; we just ignore them - [(and (not rs) (keyword