diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index d1c324d237..c38d5238c5 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -7733,6 +7733,17 @@ we will have to use something else. } handle_builtin_attribute(dict_expr, at->m_attr, loc, eles); return; + } else if (AST::is_a(*at->m_value)) { + AST::Subscript_t *s = AST::down_cast(at->m_value); + visit_Subscript(*s); + ASR::expr_t *subscript_expr = ASR::down_cast(tmp); + Vec eles; + eles.reserve(al, args.size()); + for (size_t i = 0; i < args.size(); i++) { + eles.push_back(al, args[i].m_value); + } + handle_builtin_attribute(subscript_expr, at->m_attr, loc, eles); + return; } else { throw SemanticError("Only Name type and constant integers supported in Call", loc); }