Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hcldec: A test case for attributes set to cty.DynamicVal with refinements #626

Merged
merged 1 commit into from
Aug 30, 2023

Commits on Aug 30, 2023

  1. 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.
    apparentlymart committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    c107f88 View commit details
    Browse the repository at this point in the history