Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of re-exports with identifier properties and renaming imports causes spurious ‘multiple definitions’ errors #929

Open
dpk opened this issue Mar 28, 2025 · 0 comments

Comments

@dpk
Copy link

dpk commented Mar 28, 2025

(library (beep-lib)
  (export cons beep)
  (import (chezscheme))

  (define beep 'beep)
  (define-property cons beep #t))

(library (boop-lib)
  (export button)
  (import (chezscheme)
          (rename (beep-lib)
                  (beep boop)))

  (define (button) (display boop)))

Attempting to load and import the (boop-lib) causes an error:

Exception: multiple definitions for cons in body (library (boop-lib) (export button) (import (chezscheme) (rename (...) (...))) (define (button) (display boop))) at line 1, char 1 of boop-lib.sls

This is incorrect because cons has the same binding in both libraries from which (boop-lib) imports it, and there is no identifier property conflict.

This only happens when one of the bindings imported from the re-exporting library is renamed. This library works fine:

(library (button-lib)
  (export button)
  (import (chezscheme)
          (beep-lib))

  (define (button) (display beep)))

(Chez Scheme Version 10.1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant