]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / zclconf / go-cty / cty / function / stdlib / format.go
index fb24f204694ad00bf69f6851e94358708790a314..664790b46b46322a50479723da2bf0f5fd58a7d7 100644 (file)
@@ -84,6 +84,11 @@ var FormatListFunc = function.New(&function.Spec{
                        argTy := arg.Type()
                        switch {
                        case (argTy.IsListType() || argTy.IsSetType() || argTy.IsTupleType()) && !arg.IsNull():
+                               if !argTy.IsTupleType() && !arg.IsKnown() {
+                                       // We can't iterate this one at all yet then, so we can't
+                                       // yet produce a result.
+                                       return cty.UnknownVal(retType), nil
+                               }
                                thisLen := arg.LengthInt()
                                if iterLen == -1 {
                                        iterLen = thisLen