Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Apr 19, 2023
1 parent 91a08b0 commit 39eb163
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integration_tests/aaaa1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from tmp_pkg import A, hi

def main():
hi()
a: A

main()
1 change: 1 addition & 0 deletions integration_tests/tmp_pkg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .tmp import A, hi
6 changes: 6 additions & 0 deletions integration_tests/tmp_pkg/tmp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@dataclass
class A:
x: i32

def hi():
print("hi")
4 changes: 4 additions & 0 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <lpython/semantics/python_comptime_eval.h>
#include <lpython/semantics/python_attribute_eval.h>
#include <lpython/semantics/python_intrinsic_eval.h>
#include <lpython/pickle.h>

#include <lpython/parser/parser.h>
#include <libasr/serialization.h>

Expand Down Expand Up @@ -6696,6 +6698,8 @@ Result<ASR::TranslationUnit_t*> python_ast_to_asr(Allocator &al, LocationManager
#if defined(WITH_LFORTRAN_ASSERT)
diag::Diagnostics diagnostics;
if (!asr_verify(*tu, true, diagnostics)) {

std::cerr << LCompilers::LPython::pickle(*tu, true, true, false) << std::endl;
std::cerr << diagnostics.render2();
throw LCompilersException("Verify failed");
};
Expand Down

0 comments on commit 39eb163

Please sign in to comment.