Skip to content

Commit

Permalink
Merge pull request lcompilers#757 from redbopo/error_msg
Browse files Browse the repository at this point in the history
Improve errror message on type unsupport errors.
  • Loading branch information
certik committed Jul 11, 2022
2 parents 280176a + dae66db commit f42d2dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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 @@ -790,7 +790,7 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
loc);
}

return get_type_from_var_annotation(var_annotation, loc, dims, m_args, n_args);
return get_type_from_var_annotation(var_annotation, annotation.base.loc, dims, m_args, n_args);
}

ASR::expr_t *index_add_one(const Location &loc, ASR::expr_t *idx) {
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-test_unsupported_type-0d813dd.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_unsupported_type-0d813dd.stderr",
"stderr_hash": "de666af5f0273dba4f002b2cf00eda1524fe16d3dba66583ba26f8fe",
"stderr_hash": "1675de57db132a5a4a589070d7c54ff23a57532bd967ccb416ff8c2a",
"returncode": 2
}
4 changes: 2 additions & 2 deletions tests/reference/asr-test_unsupported_type-0d813dd.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
semantic error: Unsupported type annotation: i128
--> tests/errors/test_unsupported_type.py:2:5
--> tests/errors/test_unsupported_type.py:2:8
|
2 | i: i128
| ^^^^^^^
| ^^^^

0 comments on commit f42d2dc

Please sign in to comment.