Fix merge

An incompatibility between #440 and #438 was not caught until after
merging both to the main branch.
This commit is contained in:
Alisdair McDiarmid 2021-01-06 09:34:54 -05:00
parent 0cdbaf8bd0
commit 6eb7705df8

View File

@ -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