Skip to content

Fix external inputs breaking base parameter spreads#20062

Open
polatengin wants to merge 9 commits into
mainfrom
polatengin/19954-externalinput-for-parent-bicepparam-breaks-spread-operator-for-child-bicepparam
Open

Fix external inputs breaking base parameter spreads#20062
polatengin wants to merge 9 commits into
mainfrom
polatengin/19954-externalinput-for-parent-bicepparam-breaks-spread-operator-for-child-bicepparam

Conversation

@polatengin

@polatengin polatengin commented Jul 15, 2026

Copy link
Copy Markdown
Member

Description

Fixes #19954.

When a parent parameter file contains an externalInput, using the spread operator with another inherited parameter could fail with BCP338.

In this PR;

I've added tests that reproduce the issue with ...base.B

I've fixed the issue in ExpressionBuilder by evaluating only the selected base parameter

I've also added coverage for object and array spreads, property access, bracket access, and nested parameter files

Checklist

Microsoft Reviewers: Open in CodeFlow

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 29787155084)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 29787155084
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 29787155084"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 29787155084
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 29787155084"

@levimatheri

Copy link
Copy Markdown
Contributor

Can we add a test case for this? I just tested it with your fix, but seems it's failing:

shared.bicepparam:

using none
param external = externalInput('foo', 'bar')
param B = {
  parent: 'parent'
}

main.bicepparam:

using 'main.bicep'

extends 'shared.bicepparam'
param B = {
  ...base.external
  something: 'something'
}

@polatengin

Copy link
Copy Markdown
Member Author

Can we add a test case for this? I just tested it with your fix, but seems it's failing:

@levimatheri I've added the regression test and fixed dependency tracking for selected base parameters containing externalInput.

I moved ProcessInlinableSymbol from a local function inside VisitVariableAccessSyntax to a private method so the same dependency propagation logic can also be reused by VisitPropertyAccessSyntax.

This allows base.external to mark the dependent assignment for inlining and emit the expected externalInputs(...) expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

externalInput for parent bicepparam breaks spread operator for child bicepparam

2 participants