Repository navigation
Fix ARM function naming in arity errors and enhance compile-error tests - #867
Merged
Anand Krishnamoorthi (anakrish) merged 2 commits intoOct 27, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A case with want_compile_error: false plus want_compile_error_contains, or a compile-error case that also names an effect, used to pass without checking the conflicting field. Also cover union() at the 8-argument boundary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Anand Krishnamoorthi (anakrish)
approved these changes
Oct 27, 2026
Anand Krishnamoorthi (anakrish)
merged commit Oct 27, 2026
1b92685
into
microsoft:main
60 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Arity errors in Azure Policy now name the ARM function the author wrote. Previously, more than 8 arguments to a function such as
and(),or(),union()orformat()reported the internal builtin name (builtin call … exceeds max 8 args). Now the error reads, for example,union() does not support more than 8 arguments (got 9).The compiler tracks the ARM function currently being compiled in
current_arm_function. It saves and restores that value around nested calls, so the error names the innermost function that overflowed.This PR also tightens the test harness. A case with
want_compile_error: falsepluswant_compile_error_contains, or a compile-error case that also names an effect, used to pass without checking the conflicting field. Such cases now fail.Behavior change
The error text changes. Callers in any of the 9 bindings that match on the old message will see the new text.
Tests
tests/azure_policy/cases/builtin_arity.yaml:and(),or()andunion()(generic dispatch) name the ARM function.format()).concat()still accepts more than 8 arguments.