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

multiple files import from relative parent folder won't compile #1430

Closed
mrgaturus opened this issue Aug 23, 2024 · 0 comments · Fixed by #1432
Closed

multiple files import from relative parent folder won't compile #1430

mrgaturus opened this issue Aug 23, 2024 · 0 comments · Fixed by #1432

Comments

@mrgaturus
Copy link
Contributor

mrgaturus commented Aug 23, 2024

Example

there are a foo.nim and a bar.nim in the parent folder of current module

import ../[foo, bar]

Actual Output

Error: cannot open file: ../[foo,bar]

Expected Output

modules are imported properly

Possible Solution

importing one by one each line compiles

import ../foo
import ../bar

if modules are inside a folder from relative parent folder it compiles

import ../folder/[foo, bar]

References

works on nim

github-merge-queue bot pushed a commit that referenced this issue Aug 25, 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.

---------

Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

1 participant