We should make sure the error here at least has define/contract in it (even
if it's the wrong shape due to leaving the contract out in the call), and we _should_ check to see if we're in a expression context. (Can't remember what reasoning Ryan had about not doing this, but it seems to me that we still need to check, since this expands into defines of various sorts.) svn: r11660
This commit is contained in:
parent
e1f430df72
commit
f4dd7e85fe
|
@ -77,8 +77,8 @@ improve method arity mismatch contract violation error messages?
|
||||||
(define name expr0 expr ...))]
|
(define name expr0 expr ...))]
|
||||||
[(_ name+arg-list contract body0 body ...)
|
[(_ name+arg-list contract body0 body ...)
|
||||||
(let-values ([(name lam-expr)
|
(let-values ([(name lam-expr)
|
||||||
(normalize-definition (datum->syntax #'stx (list* 'define #'name+arg-list #'body0 #'(body ...)))
|
(normalize-definition (datum->syntax #'define-stx (list* 'define/contract #'name+arg-list #'body0 #'(body ...)))
|
||||||
#'lambda #f #t)])
|
#'lambda #t #t)])
|
||||||
#`(define/contract #,name contract #,lam-expr))]
|
#`(define/contract #,name contract #,lam-expr))]
|
||||||
[(_ name contract-expr expr)
|
[(_ name contract-expr expr)
|
||||||
(raise-syntax-error 'define/contract "expected identifier in first position"
|
(raise-syntax-error 'define/contract "expected identifier in first position"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user