fix pr 10097
svn: r15722
This commit is contained in:
parent
1e5cb7d603
commit
614980f6ec
|
@ -196,8 +196,25 @@
|
||||||
#;(syntax? Type/c . -> . tc-results?)
|
#;(syntax? Type/c . -> . tc-results?)
|
||||||
(tc-expr/check form (ret expected)))
|
(tc-expr/check form (ret expected)))
|
||||||
|
|
||||||
;; tc-expr/check : syntax tc-results -> tc-results
|
|
||||||
(define (tc-expr/check form expected)
|
(define (tc-expr/check form expected)
|
||||||
|
(parameterize ([current-orig-stx form])
|
||||||
|
;(printf "form: ~a~n" (syntax->datum form))
|
||||||
|
;; the argument must be syntax
|
||||||
|
(unless (syntax? form)
|
||||||
|
(int-err "bad form input to tc-expr: ~a" form))
|
||||||
|
;; typecheck form
|
||||||
|
(let ([ty (cond [(type-ascription form) => (lambda (ann)
|
||||||
|
(let ([r (tc-expr/check/internal form ann)])
|
||||||
|
(check-below r expected)
|
||||||
|
expected))]
|
||||||
|
[else (tc-expr/check/internal form expected)])])
|
||||||
|
(match ty
|
||||||
|
[(tc-results: ts fs os)
|
||||||
|
(let ([ts* (do-inst form ts)])
|
||||||
|
(ret ts* fs os))]))))
|
||||||
|
|
||||||
|
;; tc-expr/check : syntax tc-results -> tc-results
|
||||||
|
(define (tc-expr/check/internal form expected)
|
||||||
(parameterize ([current-orig-stx form])
|
(parameterize ([current-orig-stx form])
|
||||||
;(printf "form: ~a~n" (syntax-object->datum form))
|
;(printf "form: ~a~n" (syntax-object->datum form))
|
||||||
;; the argument must be syntax
|
;; the argument must be syntax
|
||||||
|
|
Loading…
Reference in New Issue
Block a user