hclsyntax: return cty.DynamicVal when encountering (...) and unknown
vals
This commit is contained in:
parent
d9969e8731
commit
1f97062183
@ -260,6 +260,8 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti
|
||||
}
|
||||
|
||||
switch {
|
||||
case expandVal.Type().Equals(cty.DynamicPseudoType):
|
||||
return cty.DynamicVal, diags
|
||||
case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType():
|
||||
if expandVal.IsNull() {
|
||||
diags = append(diags, &hcl.Diagnostic{
|
||||
|
@ -322,6 +322,21 @@ upper(
|
||||
cty.DynamicVal,
|
||||
1, // argument cannot be null
|
||||
},
|
||||
{
|
||||
`concat(var.unknownlist...)`,
|
||||
&hcl.EvalContext{
|
||||
Functions: map[string]function.Function{
|
||||
"concat": stdlib.ConcatFunc,
|
||||
},
|
||||
Variables: map[string]cty.Value{
|
||||
"var": cty.ObjectVal(map[string]cty.Value{
|
||||
"unknownlist": cty.UnknownVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
},
|
||||
},
|
||||
cty.DynamicVal,
|
||||
0,
|
||||
},
|
||||
{
|
||||
`[]`,
|
||||
nil,
|
||||
|
Loading…
Reference in New Issue
Block a user