Skip to content

Commit 724cd91

Browse files
tjermanFajfa
authored andcommitted
Fix invalid typecheck when assigning record values
1 parent 325e11b commit 724cd91

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/compose/automation/expr_types.go

+9
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,15 @@ func composeRecordValuesTypedValueSelector(res *types.Record, k string) (expr.Ty
350350
// We'll be using types.Record for the base (and not types.RecordValueSet)
351351
func assignToComposeRecordValues(res *types.Record, p expr.Pather, val interface{}) (err error) {
352352
if p == nil || !p.More() {
353+
switch val := val.(type) {
354+
case *ComposeRecordValues:
355+
res.Values = val.value.Values
356+
return
357+
case *ComposeRecord:
358+
*res = *val.value
359+
return
360+
}
361+
353362
switch val := expr.UntypedValue(val).(type) {
354363
case types.RecordValueSet:
355364
res.Values = val

0 commit comments

Comments
 (0)