Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hcldec: A test case for attributes set to cty.DynamicVal with refinem…
…ents This test case is here to anticipate a _possible_ bug that isn't actually buggy in the current implementation: if an attribute spec is given a non-dynamic type constraint and then refined based on that type constraint then the hcldec implementation must perform the type conversion first and only then attempt to add the refinements. Another possible variation here would be for the attribute spec to have a dynamic type constraint (cty.DynamicPseudoType) and then try to refine its result. That case isn't tested here because that's always an implementation error in the calling application: RefineValueSpec must be used only in ways that are valid for the full range of types that the nested spec could produce, and there are no refinements that are valid for the full range of cty.DynamicPseudoType. That situation can and will panic at runtime, alerting the application developer that they've used hcldec incorrectly. There is no way for end-user input to cause this panic if the calling application is written correctly. This doesn't actually change the system behavior. It's a regression test to catch possible regressions under future maintenance.
- Loading branch information