Skip to content

Commit 752f0d8

Browse files
authored
Remove redundant checks for empty parameter assignments in parameter evaluation (#17807)
## Description Remove the early return in `EmitLimitationCalculator.CalculateParameterAssignments()` that skipped evaluation when a .bicepparam file contained no local `param` declarations. This ensures `extends` clauses are still resolved, imported parameter assignments flow through, and missing/invalid `extends` targets now surface diagnostics. ## Before change: Logic short‑circuited if `model.Root.ParameterAssignments.IsEmpty` OR there were parsing errors. Example .bicepparam file with only: ```bicep using 'main.bicep' extends 'not-exists.bicepparam' ``` produced no parameter evaluation and (critically) suppressed the diagnostic for the non‑existent `not-exists.bicepparam`. Imported parameters from an extended file were silently ignored when the extending file had zero local params. ## After change: - `extends` declarations are always processed (unless the syntax itself is malformed). - Missing file now produces the expected diagnostic (e.g. BCP091). - Parameters defined only in the extended file are now included in evaluation/emission. - Behavior for files that already had local params is unchanged. ## Checklist - [x] I have read and adhere to the [contribution guide](https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md). ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/17807)
1 parent d5a9da2 commit 752f0d8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Bicep.Core/Emit/EmitLimitationCalculator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,7 @@ private static ImmutableDictionary<ParameterAssignmentSymbol, ParameterAssignmen
609609
ParameterAssignmentEvaluator evaluator,
610610
IDiagnosticWriter diagnostics)
611611
{
612-
if (model.Root.ParameterAssignments.IsEmpty ||
613-
model.HasParsingErrors())
612+
if (model.HasParsingErrors())
614613
{
615614
return ImmutableDictionary<ParameterAssignmentSymbol, ParameterAssignmentValue>.Empty;
616615
}

0 commit comments

Comments
 (0)