mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
some fix
This commit is contained in:
parent
473e78f6c3
commit
83ca79e5f7
@ -351,11 +351,14 @@ public:
|
|||||||
mod->attr().set(name, type);
|
mod->attr().set(name, type);
|
||||||
_cxx_typeid_map[typeid(T)] = PK_OBJ_GET(Type, type);
|
_cxx_typeid_map[typeid(T)] = PK_OBJ_GET(Type, type);
|
||||||
T::_register(vm, mod, type);
|
T::_register(vm, mod, type);
|
||||||
if(!type->attr().contains(__new__)){
|
// check if T is trivially constructible
|
||||||
bind_func(type, __new__, -1, [](VM* vm, ArgsView args){
|
if constexpr(!std::is_default_constructible_v<T>){
|
||||||
vm->NotImplementedError();
|
if(!type->attr().contains(__new__)){
|
||||||
return vm->None;
|
bind_func(type, __new__, -1, [](VM* vm, ArgsView args){
|
||||||
});
|
vm->NotImplementedError();
|
||||||
|
return vm->None;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user