Skip to content

Commit

Permalink
Correct error
Browse files Browse the repository at this point in the history
  • Loading branch information
faze-geek committed Jun 30, 2022
1 parent 3b40692 commit b5db0c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3296,7 +3296,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
"End is expected to be of string type",
diag::Level::Error, diag::Stage::Semantic, {
diag::Label("Expected string, found: " + found,
{separator->base.loc})
{end->base.loc})
})
);
throw SemanticAbort();
Expand Down
4 changes: 2 additions & 2 deletions tests/reference/asr-test_print2-64acb15.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_print2-64acb15.stderr",
"stderr_hash": "08d27f3224fd46c2f1e6355f8d13b55c1b219aa382c53058a4d0d28c",
"returncode": 1
"stderr_hash": "e92bba85b957e7034c5172981b3b27ed7b3f0ac62167d82175890bc9",
"returncode": 2
}
34 changes: 5 additions & 29 deletions tests/reference/asr-test_print2-64acb15.stderr
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
Traceback (most recent call last):
 File "$DIR/src/bin/lpython.cpp", line 811
return emit_asr(arg_file, lpython_pass_manager, runtime_library_dir,
 File "$DIR/src/bin/lpython.cpp", line 154
r = LFortran::LPython::python_ast_to_asr(al, *ast, diagnostics, true,
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 3792
if (res2.ok) {
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 3717
b.visit_Module(ast);
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 2353
visit_stmt(*x.m_body[i]);
 File "$DIR/src/lpython/python_ast.h", line 1882
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
 File "$DIR/src/lpython/python_ast.h", line 1750
case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 2381
} else if (ASR::is_a<ASR::Function_t>(*t)) {
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 2371
transform_stmts(body, x.n_body, x.m_body);
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 2328
this->visit_stmt(*m_body[i]);
 File "$DIR/src/lpython/python_ast.h", line 1882
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
 File "$DIR/src/lpython/python_ast.h", line 1772
case stmtType::Expr: { v.visit_Expr((const Expr_t &)x); return; }
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 3299
{separator->base.loc})
 Binary file "/usr/lib/system/libsystem_platform.dylib", local address: 0x7fff5013cf59
Segfault: Signal SIGSEGV (segmentation fault) received
semantic error: End is expected to be of string type
--> tests/errors/test_print2.py:2:26
|
2 | print("a", "b", end=1)
| ^ Expected string, found: integer

0 comments on commit b5db0c2

Please sign in to comment.