Skip to content

Commit

Permalink
Fix invalid unassignability check for lists of structs
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Suleymanov <[email protected]>
  • Loading branch information
radiohead committed Sep 1, 2023
1 parent 0e55755 commit 7c39de5
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 7c39de5

Please sign in to comment.