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
cue: decode empty list as empty slice instead of slice-typed nil
These three cases weren't consistent, since using cue.Value.Decode
on an empty interface type as a destination would result in nil:
{
value: `[]`,
dst: new(interface{}),
want: ([]interface{})(nil),
}, {
value: `[]`,
dst: new([]interface{}),
want: []interface{}{},
}, {
value: `[]`,
dst: new([]int),
want: []int{},
}
Now all result in an empty slice, which is consistent and intuitive.
Closes#2471 as merged as of commit f96a18c.
Signed-off-by: Artem V. Navrotskiy <[email protected]>
Change-Id: I040c09343df12a153e6b2ee645ec9fd118b524ee
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167647
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
0 commit comments