Deprecate the keyword `var` on behalf of a new keyword `const`
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Is your feature request related to a problem? Please describe.**
The keyword `var` presumes the value assigned to the symbol is variable, that is, the concrete value referenced by the symbol changes over time. This is not the case with Bicep `var` symbols. A better label for them is `const` because their value remains unchanged once assigned.
Unlike other languages, Bicep doesn't support a mix mutable & immutable variables, so the distinction isn't important semantically for the compiler, but it does introduce ambiguity for people onboarding into Bicep
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Have `var` transition to `const`
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating how the Bicep compiler handles the `var` keyword and identify the compatibility, diagnostic, and migration scope for `const`. Done means the deprecation behavior and its impact on existing Bicep programs are defined and verified.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100