zclsyntax: operation failure diagnostics apply to whole expr
This commit is contained in:
parent
9be04673c3
commit
a0be779c9c
@ -181,8 +181,7 @@ func (e *BinaryOpExpr) Value(ctx *zcl.EvalContext) (cty.Value, zcl.Diagnostics)
|
|||||||
Severity: zcl.DiagError,
|
Severity: zcl.DiagError,
|
||||||
Summary: "Operation failed",
|
Summary: "Operation failed",
|
||||||
Detail: fmt.Sprintf("Error during operation: %s.", err),
|
Detail: fmt.Sprintf("Error during operation: %s.", err),
|
||||||
Subject: e.RHS.Range().Ptr(),
|
Subject: &e.SrcRange,
|
||||||
Context: &e.SrcRange,
|
|
||||||
})
|
})
|
||||||
return cty.UnknownVal(e.Op.Type), diags
|
return cty.UnknownVal(e.Op.Type), diags
|
||||||
}
|
}
|
||||||
@ -242,8 +241,7 @@ func (e *UnaryOpExpr) Value(ctx *zcl.EvalContext) (cty.Value, zcl.Diagnostics) {
|
|||||||
Severity: zcl.DiagError,
|
Severity: zcl.DiagError,
|
||||||
Summary: "Operation failed",
|
Summary: "Operation failed",
|
||||||
Detail: fmt.Sprintf("Error during operation: %s.", err),
|
Detail: fmt.Sprintf("Error during operation: %s.", err),
|
||||||
Subject: e.Val.Range().Ptr(),
|
Subject: &e.SrcRange,
|
||||||
Context: &e.SrcRange,
|
|
||||||
})
|
})
|
||||||
return cty.UnknownVal(e.Op.Type), diags
|
return cty.UnknownVal(e.Op.Type), diags
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user