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: Handle arrays with const as length #968

Merged

Conversation

tomlinton
Copy link
Contributor

@tomlinton tomlinton commented Nov 2, 2021

Replaces variables in array definitions with their value. One clear limitation is that if the same const is declared in different places in the crate with different values this might not use the correct one. Hopefully an uncommon case, but definitely keen on suggestions!

Closes #335
Closes #294

@tomlinton
Copy link
Contributor Author

I updated this to panic with an error if there is another const in the crate with the same name that is usize and has a different value. I think that is preferable.

@tomlinton tomlinton force-pushed the tomlinton/idl-const-array-size branch 2 times, most recently from 7d0251a to d580425 Compare December 4, 2021 03:05
@tomlinton tomlinton changed the title lang: Handle arrays with variable as length lang: Handle arrays with const as length Dec 4, 2021
@armaniferrante armaniferrante merged commit 51aeb08 into coral-xyz:master Dec 23, 2021
@armaniferrante
Copy link
Member

Thank you for this @tomlinton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants