Skip to content

x: i32[3] = [1, 2, 3] fails #324

Closed
Closed
@certik

Description

@certik
def main0():
    x: i32[3] = [1, 2, 3]
    print(x)

main0()

This prints:

$ lpython examples/expr2.py 
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
  File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 799
    err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir, compiler_options);
  File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 306
    res = fe.get_llvm3(*asr, diagnostics);
  File "/Users/ondrej/repos/lpython/src/lpython/python_evaluator.cpp", line 54
    = asr_to_llvm(asr, diagnostics,
  File "/Users/ondrej/repos/lpython/src/libasr/codegen/asr_to_llvm.cpp", line 4281
    pass_replace_print_arr(al, asr, rl_path);
  File "/Users/ondrej/repos/lpython/src/libasr/pass/print_arr.cpp", line 85
    v.visit_TranslationUnit(unit);
  File "../libasr/asr.h", line 2502
  File "../libasr/asr.h", line 2398
  File "../libasr/asr.h", line 2240
  File "../libasr/pass/pass_utils.h", line 135
  File "../libasr/pass/pass_utils.h", line 91
  File "../libasr/asr.h", line 2410
  File "../libasr/asr.h", line 2272
  File "/Users/ondrej/repos/lpython/src/libasr/pass/print_arr.cpp", line 55
    head.m_start = PassUtils::get_bound(arr_expr, i + 1, "lbound", al, unit, rl_path, current_scope);
  File "/Users/ondrej/repos/lpython/src/libasr/pass/pass_utils.cpp", line 329
    unit, rl_path, current_scope, arr_expr->base.loc);
  File "/Users/ondrej/repos/lpython/src/libasr/pass/pass_utils.cpp", line 257
    ASR::Module_t *m = LFortran::ASRUtils::load_module(al, current_scope,
  File "/Users/ondrej/repos/lpython/src/libasr/asr_utils.cpp", line 104
    loc);
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional", line 2560
    return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional", line 1885
    return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional", line 1732
    return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional", line 1558
    return _Invoker::__call(__f_.first(),
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/__functional_base", line 348
    _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
  File "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/type_traits", line 2577
    {
  File "/Users/ondrej/repos/lpython/src/libasr/pass/pass_utils.cpp", line 260
    [&](const std::string &msg, const Location &) { throw LFortranException(msg); });
LFortranException: Module 'lfortran_intrinsic_builtin' not declared in the current source and the modfile was not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions