diff --git a/pkgs/compiler-test/tests/compiler/embed/embed-me31.rkt b/pkgs/compiler-test/tests/compiler/embed/embed-me31.rkt new file mode 100644 index 0000000000..59e4077f0e --- /dev/null +++ b/pkgs/compiler-test/tests/compiler/embed/embed-me31.rkt @@ -0,0 +1,16 @@ +#lang racket/base + +;; check that `declare-preserve-for-embedding` works + +(module keep-me racket/base + (module declare-preserve-for-embedding racket/base) + (define kept "This is 31.\n") + (provide kept)) + +(display + (dynamic-require (module-path-index-join + '(submod "." keep-me) + (variable-reference->module-path-index + (#%variable-reference))) + 'kept)) + diff --git a/pkgs/compiler-test/tests/compiler/embed/test.rkt b/pkgs/compiler-test/tests/compiler/embed/test.rkt index 0d58da0c69..84a101e9f5 100644 --- a/pkgs/compiler-test/tests/compiler/embed/test.rkt +++ b/pkgs/compiler-test/tests/compiler/embed/test.rkt @@ -265,7 +265,8 @@ (one-mz-test "embed-me17.rkt" "This is 17.\n" #f) (one-mz-test "embed-me18.rkt" "This is 18.\n" #f) (one-mz-test "embed-me19.rkt" "This is 19.\n" #f) - (one-mz-test "embed-me21.rkt" "This is 21.\n" #f)) + (one-mz-test "embed-me21.rkt" "This is 21.\n" #f) + (one-mz-test "embed-me31.rkt" "This is 31.\n" #f)) ;; Try unicode expr and cmdline: (prepare dest "unicode") diff --git a/racket/collects/compiler/embed.rkt b/racket/collects/compiler/embed.rkt index 53aade8836..c398782e1b 100644 --- a/racket/collects/compiler/embed.rkt +++ b/racket/collects/compiler/embed.rkt @@ -620,7 +620,9 @@ (if (is-lib-path? module-path) ;; Preserve `lib`-ness of module reference: (collapse-module-path-index - (module-path-index-join mp module-path)) + (module-path-index-join + mp + (module-path-index-join module-path #f))) ;; Ok to collapse based on filename: (collapse-module-path-index mpi filename)) m))