Fix compiled representation of wildcard variable property references #12048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #12042
#11879 introduced a regression in references to variables imported with via wildcard syntax were represented in a template's compiled form. For example,
would generate a value of
"[variables('mod').s]"
in the compiled template. When implementing variable imports for.bicepparam
files, I took the shortcut of generating a object value for wildcard imports whose properties were all the variables exported from the imported model. There was a gap in test coverage for variable imports in.bicep
files, so the regression was not picked up. This PR updates how wildcard imports are handled in.bicepparam
files to remove the aforementioned shortcut.The PR also adds an extra step in
TemplateWriter
: after.bicep
files are converted to the compiler's intermediate representation, expressions referring to imported values are replaced with expressions that refer to "synthetic" variables and types.Microsoft Reviewers: Open in CodeFlow