Explorar el Código

Update bindings.h

blueloveTH hace 1 año
padre
commit
7873080ba2
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      include/pocketpy/bindings.h

+ 1 - 1
include/pocketpy/bindings.h

@@ -46,7 +46,7 @@ struct NativeProxyMethodC final: NativeProxyFuncCBase {
 
 
     template<typename __Ret, size_t... Is>
     template<typename __Ret, size_t... Is>
     PyObject* call(VM* vm, ArgsView args, std::index_sequence<Is...>){
     PyObject* call(VM* vm, ArgsView args, std::index_sequence<Is...>){
-        T& self = py_cast<T&>(vm, args[0]);
+        T& self = PK_OBJ_GET(T, args[0]);   // use unsafe cast for derived classes
         if constexpr(std::is_void_v<__Ret>){
         if constexpr(std::is_void_v<__Ret>){
             (self.*func)(py_cast<Params>(vm, args[Is+1])...);
             (self.*func)(py_cast<Params>(vm, args[Is+1])...);
             return vm->None;
             return vm->None;