Fix internal constructor name for struct:' so that struct-out' works.

Closes PR 12447
Related to PR 12516
This commit is contained in:
Sam Tobin-Hochstadt 2012-01-27 18:48:29 -05:00
parent f3e3eb10ad
commit c16e48a083
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
#lang typed/racket
(struct: x ())
(define-struct: y ())
(x) (y)
(provide (struct-out x) (struct-out y))

View File

@ -394,7 +394,7 @@ This file defines two sorts of primitives. All of them are provided into any mod
(syntax-parse stx
[(_ vars:maybe-type-vars nm:struct-name/new (fs:fld-spec ...) . opts)
(let ([mutable (mutable? #'opts)]
[cname (datum->syntax #f (syntax-e #'nm.name))])
[cname (datum->syntax #f (format-symbol "make-~a" (syntax-e #'nm.name)))])
(with-syntax ([d-s (syntax-property (quasisyntax/loc stx
(struct #,@(attribute nm.new-spec) (fs.fld ...)
#:extra-constructor-name #,cname