You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/reflect/slice.go
+10
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,12 @@ func reflectSlice(ctx context.Context, typ attr.Type, val tftypes.Value, target
90
90
}
91
91
92
92
returnslice, diags
93
+
93
94
// Tuple reflection into slices is currently limited to use-cases where all tuple element types are the same.
95
+
//
96
+
// Overall, Tuple support is limited in the framework, but the main path that executes tuple reflection is the provider-defined function variadic
97
+
// parameter. All tuple elements in this variadic parameter will have the same element type. For use-cases where the variadic parameter is a dynamic type,
98
+
// all elements will have the same type of `DynamicType` and value of `DynamicValue`, with an underlying value that may be different.
94
99
case attr.TypeWithElementTypes:
95
100
// we need to know the type the slice is wrapping
96
101
elemType:=target.Type().Elem()
@@ -240,7 +245,12 @@ func FromSlice(ctx context.Context, typ attr.Type, val reflect.Value, path path.
240
245
241
246
tfElems=append(tfElems, tfVal)
242
247
}
248
+
243
249
// Tuple reflection from slices is currently limited to use-cases where all tuple element types are the same.
250
+
//
251
+
// Overall, Tuple support is limited in the framework, but the main path that executes tuple reflection is the provider-defined function variadic
252
+
// parameter. All tuple elements in this variadic parameter will have the same element type. For use-cases where the variadic parameter is a dynamic type,
253
+
// all elements will have the same type of `DynamicType` and value of `DynamicValue`, with an underlying value that may be different.
244
254
case attr.TypeWithElementTypes:
245
255
iflen(t.ElementTypes()) <=0 {
246
256
// If the tuple values are empty as well, we can just pass back an empty slice of the type we received.
0 commit comments