-
Notifications
You must be signed in to change notification settings - Fork 756
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
Allow constants #3109
Comments
Variables are not allowed to be referenced in parameters, but I think this is one of those cases we can "fake" because we should be able to treat that FWIW, a |
Yup as long as the variable is a compile-time constant, it should be possible to inline it into parameters. (In the JSON, the value of the variable would be copied.) (Separately, we'd probably need to rename the internal |
Yeah it's possible to inline a constant, but I would like to point out that if we implement #622 and union type declaration, the
|
Hi tsujp, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! 😄 🦾 |
Is your feature request related to a problem? Please describe.
In order to perform the features outlined in #3110 the concept of an explicit constant is required.
The following is currently invalid, and introducing constants would allow it to become valid:
Error
Referring to
somethingAllowed
within the decorator@allowed()
.Also attempted hacks like
array(somethingAllowed)
etc do not work. It must be a literal.Describe the solution you'd like
Addition of a
const
keyword, so nowconst somethingAllowed = [ ... ]
defines an array which cannot be altered in any way and is guaranteed constant at compile time.Giving:
The text was updated successfully, but these errors were encountered: