mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 12:30:19 +00:00
some fix
This commit is contained in:
parent
7bfe8d4bbf
commit
4e8b0ea9d5
@ -103,7 +103,6 @@ struct Type {
|
||||
bool operator==(Type other) const { return this->index == other.index; }
|
||||
bool operator!=(Type other) const { return this->index != other.index; }
|
||||
constexpr operator int() const { return index; }
|
||||
constexpr operator bool() const { return index != 0; }
|
||||
};
|
||||
|
||||
#define PK_LAMBDA(x) ([](VM* vm, ArgsView args) { return x; })
|
||||
|
@ -494,7 +494,7 @@ PyVar py_var(VM* vm, __T&& value){
|
||||
return from_void_p(vm, (void*)value);
|
||||
}else{
|
||||
constexpr Type const_type = _find_type_in_const_cxx_typeid_map<T>();
|
||||
if constexpr(const_type){
|
||||
if constexpr((bool)const_type){
|
||||
if constexpr(is_sso_v<T>) return PyVar(const_type, value);
|
||||
else return vm->heap.gcnew<T>(const_type, std::forward<__T>(value));
|
||||
}
|
||||
@ -550,7 +550,7 @@ __T _py_cast__internal(VM* vm, PyVar obj) {
|
||||
return to_void_p<T>(vm, obj);
|
||||
}else{
|
||||
constexpr Type const_type = _find_type_in_const_cxx_typeid_map<T>();
|
||||
if constexpr(const_type){
|
||||
if constexpr((bool)const_type){
|
||||
if constexpr(with_check){
|
||||
if constexpr(std::is_same_v<T, Exception>){
|
||||
// Exception is `subclass_enabled`
|
||||
|
Loading…
x
Reference in New Issue
Block a user