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

fix: import current dir relative modules #1432

Merged

Conversation

saem
Copy link
Collaborator

@saem saem commented Aug 24, 2024

Summary

Attempts to import modules using relative import with multiple module
syntax like import ./[foo, bar] no longer result in an error.

Fixes: #1430

Details

./some_dir/[foo] worked because the AST resulted in an infix node
for the second directory separator / , but a prefix node when
using ./[foo] , importEval now takes this into account. A test
has been included along with the fix.

Along with this change some preexisting import statement tests were
adjusted away from using when false to flag known issues to the
builtin testament functionality of the knownissue field.

@saem saem added bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler labels Aug 24, 2024
@saem saem changed the title Saem fix relative import current dir fix: import current dir relative modules Aug 24, 2024
Copy link
Collaborator

@zerbina zerbina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a soft suggestion for improving code clarity, but the PR looks good to me otherwise.

compiler/modules/importer.nim Outdated Show resolved Hide resolved
saem and others added 2 commits August 24, 2024 16:47
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
@saem
Copy link
Collaborator Author

saem commented Aug 24, 2024

Yup, that code seems simpler

@saem
Copy link
Collaborator Author

saem commented Aug 25, 2024

/merge

Copy link

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


@chore-runner chore-runner bot enabled auto-merge August 25, 2024 00:02
@chore-runner chore-runner bot added this pull request to the merge queue Aug 25, 2024
Merged via the queue into nim-works:devel with commit 1295287 Aug 25, 2024
35 checks passed
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/sem Related to semantic-analysis system of the compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multiple files import from relative parent folder won't compile
2 participants