diff --git a/src/pocketpy.cpp b/src/pocketpy.cpp index 73ddd61f..37284b63 100644 --- a/src/pocketpy.cpp +++ b/src/pocketpy.cpp @@ -444,8 +444,8 @@ void init_builtins(VM* _vm) { return VAR(_CAST(i64, _0) % rhs); }); - _vm->bind(_vm->_t(VM::tp_int), "bit_length(self)", [](VM* vm, ArgsView args) { - i64 x = CAST(i64, args[0]); + _vm->bind_method<0>(VM::tp_int, "bit_length", [](VM* vm, ArgsView args) { + i64 x = _CAST(i64, args[0]); if(x < 0) x = -x; int bits = 0; while(x){ x >>= 1; bits++; } @@ -1633,4 +1633,4 @@ CodeObject_ VM::compile(std::string_view source, const Str& filename, CompileMod } } -} // namespace pkpy \ No newline at end of file +} // namespace pkpy