hclsyntax: Annotate diags from IndexExpr with source expr information

This commit is contained in:
Martin Atkins 2018-07-28 15:44:44 -07:00
parent f6fe9b5c69
commit b21bf61698

View File

@ -604,7 +604,9 @@ func (e *IndexExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
diags = append(diags, collDiags...)
diags = append(diags, keyDiags...)
return hcl.Index(coll, key, &e.SrcRange)
val, diags := hcl.Index(coll, key, &e.SrcRange)
setDiagEvalContext(diags, e, ctx)
return val, diags
}
func (e *IndexExpr) Range() hcl.Range {