File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -5653,7 +5653,14 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
56535653 assign_value = ASRUtils::EXPR (tmp);
56545654 }
56555655 for (size_t i=0 ; i<x.n_targets ; i++) {
5656- if (AST::is_a<AST::Constant_t>(*x.m_targets [i]) ||
5656+ if (AST::is_a<AST::ConstantStr_t>(*x.m_targets [i]) ||
5657+ AST::is_a<AST::ConstantInt_t>(*x.m_targets [i]) ||
5658+ AST::is_a<AST::ConstantBool_t>(*x.m_targets [i]) ||
5659+ AST::is_a<AST::ConstantFloat_t>(*x.m_targets [i]) ||
5660+ AST::is_a<AST::ConstantComplex_t>(*x.m_targets [i]) ||
5661+ AST::is_a<AST::ConstantEllipsis_t>(*x.m_targets [i]) ||
5662+ AST::is_a<AST::ConstantNone_t>(*x.m_targets [i]) ||
5663+ AST::is_a<AST::ConstantBytes_t>(*x.m_targets [i]) ||
56575664 AST::is_a<AST::Set_t>(*x.m_targets [i]) ||
56585665 AST::is_a<AST::Dict_t>(*x.m_targets [i])) {
56595666 throw SemanticError (" SyntaxError: cannot assign to literal" , x.m_targets [i]->base .loc );
Original file line number Diff line number Diff line change 1+ [0;31;1msemantic error[0;0m[0;1m: SyntaxError: cannot assign to literal[0;0m
2+ [0;34;1m-->[0;0m tests/errors/reproduce_bug_01.py:2:1
3+ [0;34;1m|[0;0m
4+ [0;34;1m2 |[0;0m 'a' = 1
5+ [0;34;1m|[0;0m [0;31;1m^^^ [0;0m
6+
7+
8+ [0;1mNote[0;0m: Please report unclear, confusing or incorrect messages as bugs at
9+ https://github.com/lfortran/lfortran/issues.
You can’t perform that action at this time.
0 commit comments