repair struct with same #:name and #:constructor-name identifier

Closes #3791
This commit is contained in:
Matthew Flatt 2021-04-21 11:20:36 -06:00
parent 725a7e353c
commit af40cdb7e7
2 changed files with 8 additions and 1 deletions

View File

@ -1610,6 +1610,13 @@
(struct exn:foo exn () #:constructor-name make-exn:foo)
(test "foo" exn-message (make-exn:foo "foo" (current-continuation-marks))))
(let ()
(struct foo (x) #:constructor-name Foo #:name Foo)
(test #t foo? (Foo 1))
(test 1 foo-x (Foo 1))
(test #t foo? (let-syntax ([mk (lambda (stx)
#`(#,(cadr (extract-struct-info (syntax-local-value #'Foo))) 1))])
(mk))))
;; ----------------------------------------

View File

@ -732,7 +732,7 @@
(list
(quote-syntax #,(prune struct:))
(quote-syntax #,(prune (if (and ctor-name self-ctor?)
id
ctor-name
make-)))
(quote-syntax #,(prune ?))
(list