-
Notifications
You must be signed in to change notification settings - Fork 622
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: hashicorp/hcl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.16.2
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: hashicorp/hcl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.17.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 8 commits
- 12 files changed
- 1 contributor
Commits on May 31, 2023
-
go.mod: Use cty v1.13.0, with support for refined unknown values
This new concept allows constraining the range of an unknown value beyond what can be captured in a type constraint. We'll make more use of this in subsequent commits.
Configuration menu - View commit details
-
Copy full SHA for adb8823 - Browse repository at this point
Copy the full SHA adb8823View commit details -
hclsyntax: TemplateExpr can refine its unknown results
If we encounter an interpolated unknown value during template rendering, we can report the partial buffer we've completed so far as the refined prefix of the resulting unknown value, which can then potentially allow downstream comparisons to produce a known false result instead of unknown if the prefix is sufficient to satisfy them.
Configuration menu - View commit details
-
Copy full SHA for e0058a2 - Browse repository at this point
Copy the full SHA e0058a2View commit details -
hclsyntax: ConditionalExpr can refine its unknown results
When ConditionalExpr has an unknown predicate it can still often infer some refinement to the range of its result by noticing characteristics that the two results have in common. In all cases we can test if either result could be null and return a definitely-not-null unknown value if not. For two known numbers we can constrain the range to be between those two numbers. This is primarily aimed at the common case where the two possible results are zero and one, which significantly constrains the range. For two known collections of the same kind we can constrain the length to be between the two collection lengths. In these last two cases we can also sometimes collapse the unknown into a known value if the range gets reduced enough. For example, if choosing between two collections of the same length we might return a known collection of that length containing unknown elements, rather than an unknown collection.
Configuration menu - View commit details
-
Copy full SHA for 628da05 - Browse repository at this point
Copy the full SHA 628da05View commit details -
ext/typeexpr: Refinements when applying defaults with unknown values
If either the given value is refined non-null or if the default value is refined non-null then the final attribute value after defaults processing is also guaranteed non-null even if we don't yet know exactly what the value will be. This rule is pretty marginal on its own, but refining some types of value as non-null creates opportunities to deduce further information when the value is used under other operations later, such as collapsing an unknown but definitely not null list of a known length into a known list of that length containing unknown values.
Configuration menu - View commit details
-
Copy full SHA for ea69807 - Browse repository at this point
Copy the full SHA ea69807View commit details -
hclsyntax: Refinements to unknown splat expression results
We know that a splat expression can never produce a null result, and also in many cases we can use length refinements from the source collection to also refine the destination collection because we know that a splat expression produces exactly one result for each input element. This also allows us to be a little more precise in the case where the splat operator is projecting a non-list/set value into a zero or one element list and we know the source value isn't null. This refinement is a bit more marginal since it would be weird to apply the splat operator to a value already known to be non-null anyway, but the refinement might come from far away from the splat expression and so could still have useful downstream effects in some cases.
Configuration menu - View commit details
-
Copy full SHA for 333389d - Browse repository at this point
Copy the full SHA 333389dView commit details -
This new spec type allows adding value refinements to the results of some other spec, as long as the wrapped spec does indeed enforce the constraints described by the refinements.
Configuration menu - View commit details
-
Copy full SHA for e4bd3b4 - Browse repository at this point
Copy the full SHA e4bd3b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58cc29f - Browse repository at this point
Copy the full SHA 58cc29fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7208bce - Browse repository at this point
Copy the full SHA 7208bceView commit details
There are no files selected for viewing