Browse Source

lang: Fix incorrectly checking the first init constraint (#2483)

CanardMandarin 2 years ago
parent
commit
d1ddf00293
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lang/syn/src/parser/accounts/mod.rs

+ 1 - 1
lang/syn/src/parser/accounts/mod.rs

@@ -162,7 +162,7 @@ fn constraints_cross_checks(fields: &[AccountField]) -> ParseResult<()> {
                     ));
                 }
             }
-            match kind {
+            match &field.constraints.init.as_ref().unwrap().kind {
                 // This doesn't catch cases like account.key() or account.key.
                 // My guess is that doesn't happen often and we can revisit
                 // this if I'm wrong.