lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

Direct class member access doesn't work #2723

Open Thirumalai-Shaktivel opened 3 weeks ago

Thirumalai-Shaktivel commented 3 weeks ago

MRE:

from lpython import i32

class test:
    x: i32 = 4

print(test.x)

Error:

$ lpython examples/expr2.py
ASR verify pass error: Var_t::m_v test does not point to a Variable_t, Function_t, or EnumType_t (possibly behind ExternalSymbol_t)
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
  File "/Users/thirumalai/Open_Source/lpython/src/bin/lpython.cpp", line 2170
    err = compile_python_using_llvm(arg_file, tmp_o, runtime_library_dir,
  File "/Users/thirumalai/Open_Source/lpython/src/bin/lpython.cpp", line 1010
    r1 = LCompilers::LPython::python_ast_to_asr(al, lm, nullptr, *ast, diagnostics, compiler_options,
  File "/Users/thirumalai/Open_Source/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 8432
    throw LCompilersException("Verify failed");
LCompilersException: Verify failed
Thirumalai-Shaktivel commented 3 weeks ago

Assigned: @tanay-man