operator-length.go: Fix: the returned value was int, instead of int64

This commit is contained in:
Celestino Amoroso 2024-04-27 22:37:56 +02:00
parent 895778f236
commit c5fca70cfc

View File

@ -25,12 +25,12 @@ func evalLength(ctx ExprContext, self *term) (v any, err error) {
if isList(rightValue) { if isList(rightValue) {
list, _ := rightValue.([]any) list, _ := rightValue.([]any)
v = len(list) v = int64(len(list))
} else if isString(rightValue) { } else if isString(rightValue) {
s, _ := rightValue.(string) s, _ := rightValue.(string)
v = len(s) v = int64(len(s))
} else if it, ok := rightValue.(Iterator); ok { } else if it, ok := rightValue.(Iterator); ok {
v = it.Index() v = int64(it.Index())
} else { } else {
err = self.errIncompatibleType(rightValue) err = self.errIncompatibleType(rightValue)
} }