Refactor Type to be an int
This commit is contained in:
@@ -11,7 +11,7 @@ func Max(args ...object.Object) object.Object {
|
||||
if err := typing.Check(
|
||||
"max", args,
|
||||
typing.ExactArgs(1),
|
||||
typing.WithTypes(object.ARRAY_OBJ),
|
||||
typing.WithTypes(object.ArrayType),
|
||||
); err != nil {
|
||||
return newError(err.Error())
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func Max(args ...object.Object) object.Object {
|
||||
if i, ok := e.(*object.Integer); ok {
|
||||
xs = append(xs, int(i.Value))
|
||||
} else {
|
||||
return newError("item #%d not an `int` got=%s", n, e.Type())
|
||||
return newError("item #%d not an `int` got=%d", n, e.Type())
|
||||
}
|
||||
}
|
||||
sort.Ints(xs)
|
||||
|
||||
Reference in New Issue
Block a user