operator-length.go: fixed length of list

This commit is contained in:
Celestino Amoroso 2024-05-10 09:16:31 +02:00
parent 4aa0113c6a
commit 8c66d90532

View File

@ -24,8 +24,8 @@ func evalLength(ctx ExprContext, self *term) (v any, err error) {
} }
if IsList(childValue) { if IsList(childValue) {
list, _ := childValue.([]any) ls, _ := childValue.(*ListType)
v = int64(len(list)) v = int64(len(*ls))
} else if IsString(childValue) { } else if IsString(childValue) {
s, _ := childValue.(string) s, _ := childValue.(string)
v = int64(len(s)) v = int64(len(s))