From 7c39de56215ecd31be911d76919662433e33523e Mon Sep 17 00:00:00 2001 From: Igor Suleymanov Date: Fri, 1 Sep 2023 12:59:41 +0300 Subject: [PATCH] Fix invalid unassignability check for lists of structs Signed-off-by: Igor Suleymanov --- assignable.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignable.go b/assignable.go index b1445dd..f97fba5 100644 --- a/assignable.go +++ b/assignable.go @@ -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 }