Don't allow nulls in calls to merge
This commit is contained in:
parent
9f387902fa
commit
1255ad6722
|
@ -876,7 +876,6 @@ var MergeFunc = function.New(&function.Spec{
|
|||
Name: "maps",
|
||||
Type: cty.DynamicPseudoType,
|
||||
AllowDynamicType: true,
|
||||
AllowNull: true,
|
||||
},
|
||||
Type: function.StaticReturnType(cty.DynamicPseudoType),
|
||||
Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) {
|
||||
|
|
|
@ -2045,6 +2045,17 @@ func TestMerge(t *testing.T) {
|
|||
cty.NilVal,
|
||||
true,
|
||||
},
|
||||
|
||||
{ // argument error, for a null type
|
||||
[]cty.Value{
|
||||
cty.MapVal(map[string]cty.Value{
|
||||
"a": cty.StringVal("b"),
|
||||
}),
|
||||
cty.NullVal(cty.String),
|
||||
},
|
||||
cty.NilVal,
|
||||
true,
|
||||
},
|
||||
{ // merge maps of maps
|
||||
[]cty.Value{
|
||||
cty.MapVal(map[string]cty.Value{
|
||||
|
|
Loading…
Reference in New Issue