Wrap generated code in #%expression.

This allows tc-toplevel to hand it off to tc-expr, and not reimplement
the details of annotations.
This commit is contained in:
Eric Dobson 2012-08-08 21:12:12 -07:00 committed by Sam Tobin-Hochstadt
parent 8545f421ab
commit b9408e545e

View File

@ -234,18 +234,19 @@ This file defines two sorts of primitives. All of them are provided into any mod
(syntax-parse stx
[(_ v:expr ty:expr)
(define (apply-contract ctc-expr)
#`(ann
#,(syntax-property
#`(let-values (((val) #,(syntax-property #'(ann v Any) 'with-type #t)))
(contract
#,ctc-expr
val
'cast
'typed-world
val
(quote-syntax #,stx)))
'typechecker:ignore-some #t)
ty))
#`(#%expression
(ann
#,(syntax-property
#`(let-values (((val) #,(syntax-property #'(ann v Any) 'with-type #t)))
(contract
#,ctc-expr
val
'cast
'typed-world
val
(quote-syntax #,stx)))
'typechecker:ignore-some #t)
ty)))
(if (syntax-transforming-module-expression?)
(let ((ctc (syntax-local-lift-expression