Skip to content

Assert-CrtPolicy has the same empty-array binding defect as #512, latent only because dumpbin always prints a banner #585

Description

@localai-bot

The defect

scripts/build-windows-release.ps1:86-87Assert-CrtPolicy declares
[Parameter(Mandatory)][string[]]$ImportOutput with no
[AllowEmptyCollection()]. It is byte-identical in shape to the Invoke-Checked
defect fixed under #512, and reachable from :114/:116.

Demonstrated during the review of #583: a DumpbinRunner returning no lines
yields

Cannot bind argument to parameter 'ImportOutput' because it is an empty array.

Why it has not fired

dumpbin is invoked without /nologo, so it always emits a banner and the
collection is never empty in practice. That is a coincidence of the current call
site, not a property of the function — adding /nologo, redirecting output, or
any future caller that filters lines re-arms it.

Severity

Low and pre-existing — identical on main, not currently reachable. Filed
rather than folded into #583 because that PR's scope was #512's call sites, and
widening it would have obscured the tree-equivalence its review depended on.

Done when

Assert-CrtPolicy accepts an explicitly empty import list (or refuses it with a
message that names what was missing rather than a binding error), and the pwsh
contract suite pins the empty case so it cannot regress.

Found while reviewing #583 (#512).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions