Fix/#173#174
Open
raandree wants to merge 3 commits into
Open
Conversation
…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.
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.
This pull request fixes a bug in the
Merge-Datumfunction 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 bothbaseType_arrayandhash_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:
Merge-Datuminsource/Public/Merge-Datum.ps1so that empty arrays are treated as type-compatible with bothbaseType_arrayandhash_array, preventing false "Cannot merge different types" warnings when merging empty arrays with populated arrays of hashes. This resolves issue Spurious "Cannot merge different types" warning when an empty array meets a populated array #173.Testing and validation:
tests/Unit/Public/Merge-Datum.tests.ps1to cover empty-array merge scenarios and ensure legitimate type-mismatch warnings are not suppressed.Documentation:
CHANGELOG.mdto document the bug fix and the addition of regression tests for empty-array merge cases.