Skip to content

Commit b4048fd

Browse files
authored
Merge pull request #1191 from SimonPe/patch-3
(MODULES-11099) Make merge parameter data types actually backwards compatible
2 parents 68519b5 + 0ab33ca commit b4048fd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/puppet/functions/merge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
# @return
4141
# The merged hash
4242
dispatch :merge2hashes do
43-
repeated_param 'Variant[Hash, Undef, String[0,0]]', :args # this strange type is backwards compatible
44-
return_type 'Hash'
43+
repeated_param 'Variant[Hash[Scalar,Any], Undef, String[0,0]]', :args # this strange type is backwards compatible
44+
return_type 'Hash[Scalar,Any]'
4545
end
4646

4747
# @param args

spec/functions/merge_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.with_params({}, 'two') \
1010
.and_raise_error(
1111
ArgumentError, \
12-
Regexp.new(Regexp.escape("rejected: parameter 'args' expects a value of type Undef, Hash, or String[0, 0], got String")),
12+
Regexp.new(Regexp.escape("rejected: parameter 'args' expects a value of type Undef, Hash[Scalar, Any], or String[0, 0], got String")),
1313
)
1414
}
1515
it {

0 commit comments

Comments
 (0)