code: func (s *Scope) EvalBlock(body hcl.Body, schema *configschema.Block) (cty.Value, tfdiags.Diagnostics) {
  	spec := schema.DecoderSpec()
  
  	refs, diags := ReferencesInBlock(body, schema)
  
  	ctx, ctxDiags := s.EvalContext(refs)
  	diags = diags.Append(ctxDiags)
  	if diags.HasErrors() {
  		// We'll stop early if we found problems in the references, because
  		// it's likely evaluation will produce redundant copies of the same errors.
  		return cty.UnknownVal(schema.ImpliedType()), diags
  	}
  
  	// HACK: In order to remain compatible with some assumptions made in
  	// Terraform v0.11 and earlier about the approximate equivalence of
  	// attribute vs. block syntax, we do a just-in-time fixup here to allow
  	// any attribute in the schema that has a list-of-objects or set-of-objects
  	// kind to potentially be populated instead by one or more nested blocks
  	// whose type is the attribute name.
  	body = blocktoattr.FixUpBlockAttrs(body, schema)
  
  	val, evalDiags := hcldec.Decode(body, spec, ctx)
  	diags = diags.Append(evalDiags)
  
  	return val, diags
  }
docs: // EvalBlock evaluates the given body using the given block schema and returns
  // a cty object value representing its contents. The type of the result conforms
  // to the implied type of the given schema.
  //
  // This function does not automatically expand "dynamic" blocks within the
  // body. If that is desired, first call the ExpandBlock method to obtain
  // an expanded body to pass to this method.
  //
  // If the returned diagnostics contains errors then the result may be
  // incomplete or invalid.