diff --git a/pkgs/racket-test-extra/tests/racket/struct-out-supertype.rkt b/pkgs/racket-test-extra/tests/racket/struct-out-supertype.rkt new file mode 100644 index 0000000000..2536fa5dfa --- /dev/null +++ b/pkgs/racket-test-extra/tests/racket/struct-out-supertype.rkt @@ -0,0 +1,25 @@ +#lang racket/base + +;; Regression test for GitHub issue #2123 +;; +;; +;; - define a struct (with a mutable field) +;; - inherit the struct in two other modules +;; - import the sub-structs in a new module and use struct-out on one + +(module private racket/base + (struct container (a [b #:mutable])) + (provide (struct-out container))) + +(module sub1 racket/base + (require (submod ".." private)) + (struct sub-container-1 container (c)) + (provide (struct-out sub-container-1))) + +(module sub2 racket/base + (require (submod ".." private)) + (struct sub-container-2 container (d)) + (provide (struct-out sub-container-2))) + +(require 'sub1 'sub2) +(provide (struct-out sub-container-1)) diff --git a/racket/collects/racket/private/reqprov.rkt b/racket/collects/racket/private/reqprov.rkt index 0aba11f49b..f327517c49 100644 --- a/racket/collects/racket/private/reqprov.rkt +++ b/racket/collects/racket/private/reqprov.rkt @@ -1071,7 +1071,7 @@ (list-ref super-v 3))) (list-ize (list-ref v 4) (and super-v - (list-ref super-v 3))))))) + (list-ref super-v 4))))))) (raise-syntax-error #f "identifier is not bound to struct type information"