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