diff --git a/lang/funcs/collection.go b/lang/funcs/collection.go index ab68a6411..3f0e2bd16 100644 --- a/lang/funcs/collection.go +++ b/lang/funcs/collection.go @@ -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) { diff --git a/lang/funcs/collection_test.go b/lang/funcs/collection_test.go index 581e212ff..ba79ee33b 100644 --- a/lang/funcs/collection_test.go +++ b/lang/funcs/collection_test.go @@ -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{