Skip to content

Commit

Permalink
lang: Fix compilation error when an #[account] struct has generics (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Aug 3, 2024
1 parent dc6ac2d commit 4853cd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lang/attribute/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ pub fn account(
);
format!("{discriminator:?}").parse().unwrap()
};
let disc = quote! { #account_name::DISCRIMINATOR };
let disc = if account_strct.generics.lt_token.is_some() {
quote! { #account_name::#type_gen::DISCRIMINATOR }
} else {
quote! { #account_name::DISCRIMINATOR }
};

let owner_impl = {
if namespace.is_empty() {
Expand Down

0 comments on commit 4853cd1

Please sign in to comment.