From 8c01cf72939972d4a7235a6af9ada1f8d6b429dc Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 5 Nov 2018 17:17:28 -0800 Subject: [PATCH] lang/funcs: Fix broken test for lookup function When the value we're looking in has an object type, we need to know the key in order to decide the result type. Therefore an object lookup with an unknown key must produce cty.DynamicVal, not an unknown value with a known type. --- lang/funcs/collection_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/funcs/collection_test.go b/lang/funcs/collection_test.go index a3215d9d5..202275ddc 100644 --- a/lang/funcs/collection_test.go +++ b/lang/funcs/collection_test.go @@ -1287,7 +1287,7 @@ func TestLookup(t *testing.T) { }), cty.UnknownVal(cty.String), }, - cty.UnknownVal(cty.String), + cty.DynamicVal, // if the key is unknown then we don't know which object attribute and thus can't know the type false, }, }