Make users of check-below call it with same kind arguments.

original commit: 058b67946db65bf438db441db8639c6dc3fc5734
This commit is contained in:
Eric Dobson 2014-03-13 18:50:36 -07:00
parent ccf7d79d27
commit dce4dd4ae9
4 changed files with 9 additions and 9 deletions

View File

@ -200,7 +200,7 @@
(#%plain-app values))])
(#%plain-app void))))
;; Syntax TCResults -> Type
;; Syntax Option<TCResults> -> TCResults
;; Type-check a class form by trawling its innards
;;
;; Assumptions:
@ -213,12 +213,12 @@
(define (check-class form [expected #f])
(match (and expected (resolve expected))
[(tc-result1: (and self-class-type (Class: _ _ _ _ _ _)))
(parse-and-check form self-class-type)]
(ret (parse-and-check form self-class-type))]
[(tc-result1: (Poly-names: ns body-type))
;; FIXME: this case probably isn't quite right
(check-class form (ret body-type))]
[#f (parse-and-check form #f)]
[_ (check-below (parse-and-check form #f) expected)]))
[#f (ret (parse-and-check form #f))]
[_ (check-below (ret (parse-and-check form #f)) expected)]))
;; Syntax Option<Type> -> Type
;; Parse the syntax and extract useful information to pass to the

View File

@ -20,7 +20,7 @@
[cond-contracted check-subforms/with-handlers/check (syntax? tc-results/c . -> . any)]))
(define-signature check-class^
([cond-contracted check-class (syntax? (or/c tc-results/c #f) . -> . any)]))
([cond-contracted check-class (syntax? (or/c tc-results/c #f) . -> . tc-results/c)]))
(define-signature tc-if^
([cond-contracted tc/if-twoarm ((syntax? syntax? syntax?) (tc-results/c) . ->* . tc-results/c)]))

View File

@ -30,8 +30,8 @@
[_
(match (tc-expr expr)
[(tc-result1: (Value: (? number? i))) i]
[type
(check-below type -Integer)
[tc-results
(check-below tc-results (ret -Integer))
#f])]))
(define (index-error i-val i-bound expr type expected name)
@ -70,7 +70,7 @@
[(not i-val)
(define val-t (single-value val-e))
(for ((es-type (in-list es-t)))
(check-below val-t es-type))
(check-below val-t (ret es-type)))
(cond-check-below (ret -Void) expected)]
[else
(single-value val-e)

View File

@ -374,7 +374,7 @@
(syntax-parse form
#:literal-sets (kernel-literals tc-expr-literals)
[stx:tr:class^
(ret (check-class form #f))]
(check-class form #f)]
;;
[stx:exn-handlers^
(register-ignored! form)