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
{{ message }}
Repository navigation
Allow to initialize nested structs using "Transactions(transactions=[], accounts=[])" #2428
The workaround above gives ASR, but fails to compile:
$ lpython -I. process.pyASR verify pass error: ASR verify: The symbol table was not found in the scope of `symtab`.ASR verify pass error: ASR verify: Struct::m_derived_type 'Transaction' cannot point outside of its symbol table, owner: modelInternal Compiler Error: Unhandled exceptionTraceback (most recent call last): File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 1869 err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir, File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 828 res = fe.get_llvm3(*asr, pass_manager, diagnostics, infile); File "/Users/ondrej/repos/lpython/src/lpython/python_evaluator.cpp", line 71 run_fn, infile); File "/Users/ondrej/repos/lpython/src/libasr/codegen/asr_to_llvm.cpp", line 8933 pass_manager.apply_passes(al, &asr, pass_options, diagnostics); File "/Users/ondrej/repos/lpython/src/libasr/pass/pass_manager.h", line 305 apply_passes(al, asr, _passes, pass_options, diagnostics); File "/Users/ondrej/repos/lpython/src/libasr/pass/pass_manager.h", line 169 + passes[i]);LCompilersException: Verify failed in the pass: class_constructor
I am able to reproduce the issue for the workaround code when I use two different modules/files. One contains the definition of the classes and in the other file i import the classes and use the workaround initialization but when I put definition and initialization in a single file I am not able to reproduce it.
Activity
certik commentedon Nov 18, 2023
The workaround above gives ASR, but fails to compile:
arteevraina commentedon Nov 20, 2023
Hi @certik ,
I tried to reproduce the above issue for the work around code.
I am able to reproduce the issue for the workaround code when I use two different modules/files. One contains the definition of the classes and in the other file i import the classes and use the workaround initialization but when I put definition and initialization in a single file I am not able to reproduce it.
certik commentedon Nov 20, 2023
Yes, I was using two different files.
certik commentedon Dec 8, 2023
To fix this, we need to do lfortran/lfortran#2957.