racket/unit: fix #:omit-constructor

Closes #1006, with a test case based on that report.
This commit is contained in:
Matthew Flatt 2015-08-31 16:20:52 -06:00
parent 38317b87c2
commit f09c78b5f4
2 changed files with 17 additions and 1 deletions

View File

@ -2185,3 +2185,17 @@
(test '(0 0) (dynamic-require ''check-define-values-invoke-unit-spec 'results))
;; ----------------------------------------
(let ((s 1))
(define-signature sig (an-s (struct s (x y) #:omit-constructor)))
(test '(1 2)
(invoke-unit
(compound-unit (import) (export)
(link (((S : sig)) (unit (import) (export sig)
(define-struct s (x y))
(define an-s (s 1 2))))
(() (unit (import sig) (export)
(match an-s
[(s x y) (list x y)]))
S))))))

View File

@ -270,7 +270,9 @@
(cons opt-cname opt-cname))]
[extra-make? #f]
[else (cons def-cname #'name)])]
[(self-ctr?) (and cname (bound-identifier=? #'name (cdr cname)))])
[(self-ctr?) (and cname
(bound-identifier=? #'name (cdr cname))
(not no-ctr?))])
(cons
#`(define-syntaxes (name)
#,(let ([e (build-struct-expand-info