Skip to content

Fix/#173#174

Open
raandree wants to merge 3 commits into
gaelcolas:mainfrom
raandree:fix/#173
Open

Fix/#173#174
raandree wants to merge 3 commits into
gaelcolas:mainfrom
raandree:fix/#173

Conversation

@raandree

@raandree raandree commented May 6, 2026

Copy link
Copy Markdown
Collaborator

This pull request fixes a bug in the Merge-Datum function where merging an empty array with a populated array of hashes would incorrectly trigger a type-mismatch warning. Now, empty arrays are treated as type-compatible with both baseType_array and hash_array, allowing for clear-overrides and placeholder lists without spurious warnings. It also adds regression tests to ensure the fix works and that real type mismatches still produce warnings.

Bug fix:

Testing and validation:

  • Added comprehensive regression tests in tests/Unit/Public/Merge-Datum.tests.ps1 to cover empty-array merge scenarios and ensure legitimate type-mismatch warnings are not suppressed.

Documentation:

  • Updated CHANGELOG.md to document the bug fix and the addition of regression tests for empty-array merge cases.

raandree added 3 commits May 5, 2026 18:35
…gaelcolas#173)

An empty array (@()) on either side of Merge-Datum no longer raises
"Cannot merge different types" against a populated hash_array. The
empty side now adopts the populated side's type before the
type-compatibility check, but only when both sides are array types.
Genuine mismatches (e.g. hashtable vs hash_array) still warn.
@raandree raandree requested a review from gaelcolas May 6, 2026 07:08
@raandree raandree added the bug label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant