Skip to content

idl: Disallow multiple error definitions#4300

Open
acheroncrypto wants to merge 3 commits intosolana-foundation:masterfrom
acheroncrypto:idl-disallow-multiple-error-definitions
Open

idl: Disallow multiple error definitions#4300
acheroncrypto wants to merge 3 commits intosolana-foundation:masterfrom
acheroncrypto:idl-disallow-multiple-error-definitions

Conversation

@acheroncrypto
Copy link
Collaborator

@acheroncrypto acheroncrypto commented Mar 9, 2026

Problem

Having multiple error definitions is not supported, but you don't get any errors when you do have them. Instead, the compiler chooses one of the definitions and discards the rest.

Summary of changes

Make having multiple error definitions a hard error during IDL generation.

Progress

  • Add multiple-errors tests that checks for the desired behavior (error when there are multiple error definitions i.e. enums with #[error_code]) (CI):

    1) multiple-errors
         Returns 'multiple errors' error on builds:
       Error: No error on build
    
  • Disallow multiple error definitions

Fixes #3532

@vercel
Copy link

vercel bot commented Mar 9, 2026

@acheroncrypto is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added breaking idl related to the IDL, either program or client side fix Bug fix PR labels Mar 9, 2026
@acheroncrypto acheroncrypto marked this pull request as ready for review March 10, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking fix Bug fix PR idl related to the IDL, either program or client side

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDL generation is not stable.

1 participant