Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lang: Fix adding derives and reprs to type alias definitions #3504

Conversation

acheroncrypto
Copy link
Collaborator

Problem

We're adding derives and reprs to all definitions (struct, enum and type) in declare_program!:

However, as reported in #3490, this doesn't work with type aliases, and you get a compile error:

error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s

Summary of changes

Fix incorrectly adding derives and reprs to type alias definitions. In other words, only add derives and reprs to struct and enum definitions.

Fixes #3490

Copy link

vercel bot commented Jan 21, 2025

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang fix Bug fix PR labels Jan 21, 2025
@acheroncrypto acheroncrypto merged commit 5d0fe35 into coral-xyz:master Jan 22, 2025
0 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PR lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

declare_program! macro panic with derive may only be applied to structs, enums and unions
1 participant