Skip to content

Commit

Permalink
add doc note
Browse files Browse the repository at this point in the history
  • Loading branch information
austinvalle committed Feb 16, 2024
1 parent 160c1f3 commit caa6358
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/reflect/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func reflectSlice(ctx context.Context, typ attr.Type, val tftypes.Value, target
}

return slice, diags
// Tuple reflection into slices is currently limited to use-cases where all tuple element types are the same.
case attr.TypeWithElementTypes:
// we need to know the type the slice is wrapping
elemType := target.Type().Elem()
Expand Down Expand Up @@ -240,7 +241,7 @@ func FromSlice(ctx context.Context, typ attr.Type, val reflect.Value, path path.

tfElems = append(tfElems, tfVal)
}
// Tuple reflection from slices is currently not supported as usage is limited
// Tuple reflection from slices is currently limited to use-cases where all tuple element types are the same.
case attr.TypeWithElementTypes:
if len(t.ElementTypes()) <= 0 {
// If the tuple values are empty as well, we can just pass back an empty slice of the type we received.
Expand Down

0 comments on commit caa6358

Please sign in to comment.