We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3b62cb commit 8f557cbCopy full SHA for 8f557cb
src/lpython/semantics/python_ast_to_asr.cpp
@@ -5654,6 +5654,11 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
5654
assign_value = ASRUtils::EXPR(tmp);
5655
}
5656
for (size_t i=0; i<x.n_targets; i++) {
5657
+ if (AST::is_a<AST::Constant_t>(*x.m_targets[i]) ||
5658
+ AST::is_a<AST::Set_t>(*x.m_targets[i]) ||
5659
+ AST::is_a<AST::Dict_t>(*x.m_targets[i])) {
5660
+ throw SemanticError("SyntaxError: cannot assign to literal", x.m_targets[i]->base.loc);
5661
+ }
5662
tmp_value = assign_value;
5663
check_is_assign_to_input_param(x.m_targets[i]);
5664
if (AST::is_a<AST::Subscript_t>(*x.m_targets[i])) {
0 commit comments