code: func (d *InstanceDiff) ApplyToValue(base cty.Value, schema *configschema.Block) (cty.Value, error) {
  	// Create an InstanceState attributes from our existing state.
  	// We can use this to more easily apply the diff changes.
  	attrs := hcl2shim.FlatmapValueFromHCL2(base)
  	applied, err := d.Apply(attrs, schema)
  	if err != nil {
  		return base, err
  	}
  
  	val, err := hcl2shim.HCL2ValueFromFlatmap(applied, schema.ImpliedType())
  	if err != nil {
  		return base, err
  	}
  
  	return schema.CoerceValue(val)
  }
docs: // ApplyToValue merges the receiver into the given base value, returning a
  // new value that incorporates the planned changes. The given value must
  // conform to the given schema, or this method will panic.
  //
  // This method is intended for shimming old subsystems that still use this
  // legacy diff type to work with the new-style types.