You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ lpython issue/main.py
ASR verify pass error: Module __main__ dependencies must contain string because a function present in it is getting called in __main__.
Internal Compiler Error: Unhandled exception
I think I've found the issue. Import dependency checking doesn't ignore the local use of module variables. Below is a minimal reproduction of the error.
foo.py
a:i32=10b:i32=a+10
main.py
import foo
Here the asr verifier sees that b needs as a dependencya which in turn leads foo to have itself as a dependency. This is what I think is happening, there are still a couple details to work out like how does it work when the import is used but I'll start working on a fix and open a PR.
Activity
[-]Import causes unhandles exception[/-][+]Import causes unhandled exception[/+]swamishiju commentedon Mar 15, 2025
Well i found another issue with imports I believe both are linked
The above code works and gives output
When we move the class definition into a separate python file
foo.py
main.py
Now this code gives
Internal Compiler Error: Unhandled exceptionbut both give the same output with CPythonswamishiju commentedon Mar 15, 2025
I think I've found the issue. Import dependency checking doesn't ignore the local use of module variables. Below is a minimal reproduction of the error.
foo.py
main.py
Here the asr verifier sees that
bneeds as a dependencyawhich in turn leads foo to have itself as a dependency. This is what I think is happening, there are still a couple details to work out like how does it work when the import is used but I'll start working on a fix and open a PR.swamishiju commentedon Mar 23, 2025
Related issue to the first one
foo.py
bar.py
main.py