Reproduced by circom/tests/circom_doc_examples/04.circom.
It tries to lookup AND as a function but it's a template. Stack trace shows this happens in DeclarationInfo::from_template() which means information about all templates has not yet been collected and thus the confusion. Near the top of the stack, it's trying to generate a poly.expr for a dimension expression when it encounters the AND() call and tries to generate it as a function call.
Reproduced by
circom/tests/circom_doc_examples/04.circom.It tries to lookup
ANDas a function but it's a template. Stack trace shows this happens inDeclarationInfo::from_template()which means information about all templates has not yet been collected and thus the confusion. Near the top of the stack, it's trying to generate apoly.exprfor a dimension expression when it encounters theAND()call and tries to generate it as a function call.