Skip to content

Commit 68764fc

Browse files
committed
fix: correct implementation of List::insert
1 parent adf813c commit 68764fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

argon/vm/datatype/list.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ ARGON_METHOD(list_insert, insert,
104104
bool ok = false;
105105

106106
if (AR_TYPEOF(*args, type_int_))
107-
ok = ListInsert(self, args[0], ((Integer *) args[1])->sint);
107+
ok = ListInsert(self, args[1], ((Integer *) args[0])->sint);
108108
else if (AR_TYPEOF(*args, type_uint_))
109-
ok = ListInsert(self, args[0], (ArSSize) ((Integer *) args[1])->uint);
109+
ok = ListInsert(self, args[1], (ArSSize) ((Integer *) args[0])->uint);
110110
else
111111
ErrorFormat(kTypeError[0], "expected %s/%s, got '%s'", type_int_->name,
112112
type_uint_->name, AR_TYPE_NAME(args[0]));

0 commit comments

Comments
 (0)