Fix bug with clamp

This commit is contained in:
gingerBill
2019-05-06 18:29:22 +01:00
parent ab0afa548b
commit 00c0ce45b3

View File

@@ -4076,7 +4076,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
case BuiltinProc_clamp: {
// clamp :: proc(a, min, max: ordered) -> ordered
Type *type = base_type(operand->type);
Type *type = operand->type;
if (!is_type_ordered(type) || !(is_type_numeric(type) || is_type_string(type))) {
gbString type_str = type_to_string(operand->type);
error(call, "Expected a ordered numeric or string type to 'clamp', got '%s'", type_str);