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) {
list, _ := rightValue.([]any)
v = len(list)
v = int64(len(list))
} else if isString(rightValue) {
s, _ := rightValue.(string)
v = len(s)
v = int64(len(s))
} else if it, ok := rightValue.(Iterator); ok {
v = it.Index()
v = int64(it.Index())
} else {
err = self.errIncompatibleType(rightValue)
}