opentofu/internal/lang
Martin Atkins 81c15f987e lang/funcs: startswith considers string prefix refinement
If the string to be tested is an unknown value that's been refined with
a prefix and the prefix we're being asked to test is in turn a prefix of
that known prefix then we can return a known answer despite the inputs
not being fully known.

There are also some other similar deductions we can make about other
combinations of inputs.

This extra analysis could be useful in a custom condition check that
requires a string with a particular prefix, since it can allow the
condition to fail even on partially-unknown input, thereby giving earlier
feedback about a problem.
2023-05-24 13:44:08 -07:00
..
blocktoattr [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
funcs lang/funcs: startswith considers string prefix refinement 2023-05-24 13:44:08 -07:00
globalref [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
marks [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
testdata/functions-test Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
types [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
data_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
data.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
doc.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
functions_descriptions_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
functions_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
functions.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
references.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
scope.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00