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

Module package error misreported as package having two different paths. #315

Open
typeswitch-dev opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working compiler Compiler internals.

Comments

@typeswitch-dev
Copy link
Contributor

To reproduce, have a package (for example arg-parser) that contains a module (for example something), with a module header that claims the module is part of a different package instead (for example std):

module(std.something)

When importing the module arg-parser.something you get the following error message:

Tried to set different path for the same package.
        Package: std
        Path 1: "lib\\arg-parser"
        Path 2: "lib\\std"

Which is confusing, it should really say that the module header for arg-parser.something is wrong.

For future reference, I also got this stack trace while running with a debug build of the compiler:

call stack:
    path! at src\elab.mth:1287:26
    check-module-path at src\elab.mth:1270:9     
    elab-module-header! at src\elab.mth:1245:5   
    elab-module! at src\elab.mth:1322:13
    load-module at src\elab.mth:1333:5
    elab-module-import! at src\elab.mth:1296:31  
    elab-module-decl! at src\elab.mth:1246:32    
    elab-module! at src/main.mth:83:5
    compile! at src/main.mth:214:5
    main at src/main.mth:150:5
@typeswitch-dev typeswitch-dev added bug Something isn't working compiler Compiler internals. labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Compiler internals.
Projects
None yet
Development

No branches or pull requests

1 participant