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

Only emit the error for Structs for now #2140

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Only emit the error for Structs for now #2140

merged 1 commit into from
Jul 10, 2023

Conversation

certik
Copy link
Contributor

@certik certik commented Jul 10, 2023

No description provided.

@certik
Copy link
Contributor Author

certik commented Jul 10, 2023

In Main, I get:

Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
  File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 1767
    return emit_c(arg_file, runtime_library_dir, lpython_pass_manager,
  File "/Users/ondrej/repos/lpython/src/bin/lpython.cpp", line 333
    r1 = LCompilers::LPython::python_ast_to_asr(al, lm, nullptr, *ast, diagnostics, compiler_options, true, "", infile);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 7670
    auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module, module_name,
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 7621
    BodyVisitor b(al, lm, unit, diagnostics, main_module, module_name, ast_overload, allow_implicit_casting);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4724
    visit_stmt(*x.m_body[i]);
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1883
    void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1751
    case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4837
    handle_fn(x, *f);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4813
    transform_stmts(body, x.n_body, x.m_body);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4684
    this->visit_stmt(*m_body[i]);
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1883
    void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1758
    case stmtType::AnnAssign: { v.visit_AnnAssign((const AnnAssign_t &)x); return; }
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 5560
    transform_stmts(body, x.n_body, x.m_body);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4684
    this->visit_stmt(*m_body[i]);
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1883
    void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
  File "/Users/ondrej/repos/lpython/src/lpython/python_ast.h", line 1757
    case stmtType::AugAssign: { v.visit_AugAssign((const AugAssign_t &)x); return; }
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4963
    visit_AnnAssignUtil(x, var_name, init_expr);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 2853
    pptr_shape, x.base.base.loc);
  File "/Users/ondrej/repos/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 2738
    ASR::StructType_t *st = ASR::down_cast<ASR::StructType_t>(ASR::down_cast<ASR::Struct_t>(asr_alloc_type)->m_derived_type);
  File "/Users/ondrej/repos/lpython/src/libasr/asr.h", line 41
    LCOMPILERS_ASSERT(is_a<T>(*f));
AssertFailed: is_a<T>(*f)

This is now fixed.

@certik certik enabled auto-merge July 10, 2023 06:04
@certik certik added the BLOCKER workaround not found yet label Jul 10, 2023
@certik certik merged commit a2715e6 into lcompilers:main Jul 10, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKER workaround not found yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant