String interpolation allows object and array types as expressions
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Bicep version**
v.0.3.1
**Describe the bug**
The following is permitted:
```bicep
var myObj = {
val: true
}
var myArray = [
12
34
]
output test string = '${myObj}..${myArray}'
```
It feels like it would be better to require an explicit conversion, as more often than not, conversion from obj or array to string will be accidental or yield unexpected results.
We should however be careful to ensure there is an option for people who have a legitimate need to perform a `toJson` conversion.
Created from #208
Contributor guide
Research direction
Reproduce the Bicep example showing object and array values used in string interpolation, then review the discussion from #208 for the intended conversion behavior. Done means interpolation rejects object and array values unless explicitly converted, while a legitimate toJson conversion remains available.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100