For other ProvisionableConstruct or ProvisionableResource, if I assign something as a value of their properties, like this:
var kvSku = new KeyVaultSku { Name = skuName, Family = KeyVaultSkuFamily.A, };
var kvProperties = new KeyVaultProperties();
kvProperties.Sku = kvSku;
There is a kvSku instance, once I assign that as a property of kvProperties, some internal status changed for this instance, which tracks where this instance is used as its context of usage.
But BicepList and BicepDictionary currently does not have that mechanism.
If I do this:
var policy = new KeyVaultAccessPolicy();
kvProperties.AccessPolicies.Add(policy);
the policy instance is as clean as it is newly created - it never leaves a mark on this instance that this instance has been used as an item of a BicepList.
This bug creates challenges when we are trying to support more complicated scenarios of bicep building.