From 69a2d44513c72cb3127532d73acb4215bec26991 Mon Sep 17 00:00:00 2001 From: migui3230 <74937076+migui3230@users.noreply.github.com> Date: Fri, 11 Mar 2022 17:56:35 -0500 Subject: [PATCH] print composite field type if the parser cannot resolve it (#1506) --- lang/syn/src/idl/file.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/syn/src/idl/file.rs b/lang/syn/src/idl/file.rs index 7814c9cb9..2f14100e4 100644 --- a/lang/syn/src/idl/file.rs +++ b/lang/syn/src/idl/file.rs @@ -513,9 +513,9 @@ fn idl_accounts( .iter() .map(|acc: &AccountField| match acc { AccountField::CompositeField(comp_f) => { - let accs_strct = global_accs - .get(&comp_f.symbol) - .expect("Could not resolve Accounts symbol"); + let accs_strct = global_accs.get(&comp_f.symbol).unwrap_or_else(|| { + panic!("Could not resolve Accounts symbol {}", comp_f.symbol) + }); let accounts = idl_accounts(ctx, accs_strct, global_accs, seeds_feature); IdlAccountItem::IdlAccounts(IdlAccounts { name: comp_f.ident.to_string().to_mixed_case(),