Explorar o código

fix new_object<>

blueloveTH hai 1 ano
pai
achega
5a6ede01d1
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      include/pocketpy/interpreter/vm.hpp

+ 2 - 2
include/pocketpy/interpreter/vm.hpp

@@ -445,8 +445,8 @@ public:
 
 
     template<typename T, typename ...Args>
     template<typename T, typename ...Args>
     PyVar new_object(Type type, Args&&... args){
     PyVar new_object(Type type, Args&&... args){
-        if constexpr(is_sso_v<T>) return PyVar(type, T(std::forward<Args>(args)...));
-        else return heap.gcnew<T>(type, std::forward<Args>(args)...);
+        static_assert(!is_sso_v<T>);
+        return heap.gcnew<T>(type, std::forward<Args>(args)...);
     }
     }
 #endif
 #endif