Skip to content

Commit

Permalink
Merge pull request #194 from grafana/fix/struct-list
Browse files Browse the repository at this point in the history
Fix invalid unassignability check for lists of structs
  • Loading branch information
radiohead committed Sep 20, 2023
2 parents 0e55755 + 7c39de5 commit fb9338e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assignable.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func assignable(sch cue.Value, T interface{}) error {
// just drop the marked/default value, and not indicate an OrOp at all. This is handy,
// but unexpected behavior, and it feels dangerous to rely on.
_, evals := sval.Expr()
if len(evals) != 1 {
if len(evals) > 2 {
errs[p.String()] = fmt.Errorf("%s: schema is a complex disjunction of list types, may only correspond to interface{}/any", p)
return
}
Expand Down

0 comments on commit fb9338e

Please sign in to comment.