Skip to content

fix: Make fields in tuple structs public#2994

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
cryptopapi997:pub-tuple-structs
May 30, 2024
Merged

fix: Make fields in tuple structs public#2994
acheroncrypto merged 3 commits into
otter-sec:masterfrom
cryptopapi997:pub-tuple-structs

Conversation

@cryptopapi997

Copy link
Copy Markdown
Contributor

Currently when defining a tuple struct in an external program such as struct T(pub u32), declare_program! will transform this into struct T(u32). This effectively means initializing T in the program importing it isn't possible. This also differs from how normal structs work where each field is automatically made public. This PR changes this for tuple structs and makes each field of the tuple public too.

@vercel

vercel Bot commented May 30, 2024

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@cryptopapi997 cryptopapi997 changed the title Make fields in tuple structs public fix: Make fields in tuple structs public May 30, 2024
@acheroncrypto acheroncrypto added lang fix Bug fix PR labels May 30, 2024
Comment thread CHANGELOG.md Outdated

@acheroncrypto acheroncrypto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, they should be public. Thanks!

@acheroncrypto acheroncrypto merged commit 5601702 into otter-sec:master May 30, 2024
@cryptopapi997 cryptopapi997 deleted the pub-tuple-structs branch May 30, 2024 21:15
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
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.

2 participants