diff --git a/collects/mzlib/unit.ss b/collects/mzlib/unit.ss index c782631fb6..373da47bfa 100644 --- a/collects/mzlib/unit.ss +++ b/collects/mzlib/unit.ss @@ -307,6 +307,7 @@ (with-syntax (((super-rtime ...) super-rtimes) ((super-name ...) super-names) ((var ...) all-bindings) + ((ctc ...) all-ctcs) ((((vid ...) . vbody) ...) all-val-defs) ((((sid ...) . sbody) ...) all-stx-defs)) #`(begin @@ -333,7 +334,14 @@ (quote-syntax #,c)) #'#f)) all-ctcs)) - (quote-syntax #,sigid)))))))) + (quote-syntax #,sigid)))) + (define-values () + (begin + (λ (var ...) + (letrec-syntaxes+values + ([(sid ...) sbody] ...) ([(vid ...) vbody] ...) + ctc ...)) + (values))))))) (else (syntax-case (car sig-exprs) (define-values define-syntaxes contracted) (x diff --git a/collects/tests/units/test-unit-contracts.ss b/collects/tests/units/test-unit-contracts.ss index 0ae86e2815..5ba743dd0c 100644 --- a/collects/tests/units/test-unit-contracts.ss +++ b/collects/tests/units/test-unit-contracts.ss @@ -103,6 +103,13 @@ (test-syntax-error "identifier not first part of pair after contracted in signature" (define-signature x ((contracted [(-> number? number?) x])))) +(test-syntax-error "identifier h? not bound anywhere" + (module h?-test scheme + (define-signature s^ + ((define-values (f?) (values number?)) + (define-syntaxes (g?) (make-rename-transformer #'number?)) + (contracted [f (-> f? (and/c g? h?))]))))) + (test-syntax-error "f not defined in unit exporting sig3" (unit (import) (export sig3 sig4) (define a #t)