From 6eb7705df85c11accee4ee1d415699ae67ad9f4e Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Wed, 6 Jan 2021 09:34:54 -0500 Subject: [PATCH] Fix merge An incompatibility between #440 and #438 was not caught until after merging both to the main branch. --- hclsyntax/expression.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/hclsyntax/expression.go b/hclsyntax/expression.go index 41c8b77..63f2e88 100644 --- a/hclsyntax/expression.go +++ b/hclsyntax/expression.go @@ -1139,13 +1139,7 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { // Extract and merge marks from the include expression into the // main set of marks includeUnmarked, includeMarks := include.Unmark() - if marks == nil { - marks = includeMarks - } else { - for k := range includeMarks { - marks[k] = struct{}{} - } - } + marks = append(marks, includeMarks) if includeUnmarked.False() { // Skip this element continue @@ -1296,13 +1290,7 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { // Extract and merge marks from the include expression into the // main set of marks includeUnmarked, includeMarks := include.Unmark() - if marks == nil { - marks = includeMarks - } else { - for k := range includeMarks { - marks[k] = struct{}{} - } - } + marks = append(marks, includeMarks) if includeUnmarked.False() { // Skip this element continue