Add duplicate checking to exports list.

svn: r11761
This commit is contained in:
Stevie Strickland 2008-09-15 19:53:41 +00:00
parent e40c856660
commit deccda53ea

View File

@ -225,7 +225,13 @@ improve method arity mismatch contract violation error messages?
[(expanded-bodies) (head-expand-all (cons #'body0 [(expanded-bodies) (head-expand-all (cons #'body0
(syntax->list #'(body ...))))]) (syntax->list #'(body ...))))])
(begin (begin
(check-exports (append unprotected protected) expanded-bodies) (let* ([all-ids (append unprotected protected)]
[dupd-id (check-duplicate-identifier all-ids)])
(when dupd-id
(raise-syntax-error 'with-contract
"identifier appears twice in exports"
dupd-id))
(check-exports (append unprotected protected) expanded-bodies))
(with-syntax ([((protected-id id contract-id) ...) (with-syntax ([((protected-id id contract-id) ...)
(map (lambda (n) (map (lambda (n)
(list n (list n