Skip to content

Commit

Permalink
Better error messages in List.sort
Browse files Browse the repository at this point in the history
  • Loading branch information
bamless committed Feb 11, 2024
1 parent b975ea5 commit e73dbbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "gc.h"
#include "hashtable.h"
#include "import.h"
#include "jstar.h"
#include "object.h"
#include "profiler.h"
#include "util.h"
Expand Down Expand Up @@ -676,6 +677,9 @@ static bool lessEqCompare(JStarVM* vm, Value a, Value b, Value comparator, bool*
push(vm, b);

if(jsrCallMethod(vm, "__le__", 1) != JSR_SUCCESS) {
jsrPop(vm);
jsrRaise(vm, "TypeException", "Operator <= not defined for type %s, %s",
getClass(vm, a)->name->data, getClass(vm, b)->name->data);
return false;
}

Expand Down

0 comments on commit e73dbbd

Please sign in to comment.