MCPcopy
hub / github.com/hashicorp/hcl / decode

Method decode

hcldec/spec.go:1645–1655  ·  hcldec/spec.go::RefineValueSpec.decode
(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext)

Source from the content-addressed store, hash-verified

1643}
1644
1645func (s *RefineValueSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
1646 wrappedVal, diags := s.Wrapped.decode(content, blockLabels, ctx)
1647 if diags.HasErrors() {
1648 // We won't try to run our function in this case, because it'll probably
1649 // generate confusing additional errors that will distract from the
1650 // root cause.
1651 return cty.UnknownVal(s.impliedType().WithoutOptionalAttributesDeep()), diags
1652 }
1653
1654 return wrappedVal.RefineWith(s.Refine), diags
1655}
1656
1657func (s *RefineValueSpec) impliedType() cty.Type {
1658 return s.Wrapped.impliedType()

Callers

nothing calls this directly

Calls 3

impliedTypeMethod · 0.95
HasErrorsMethod · 0.80
decodeMethod · 0.65

Tested by

no test coverage detected