diff --git a/include/pocketpy/interpreter/vm.hpp b/include/pocketpy/interpreter/vm.hpp index 27c51ee4..5ad9387a 100644 --- a/include/pocketpy/interpreter/vm.hpp +++ b/include/pocketpy/interpreter/vm.hpp @@ -445,8 +445,8 @@ public: template PyVar new_object(Type type, Args&&... args){ - if constexpr(is_sso_v) return PyVar(type, T(std::forward(args)...)); - else return heap.gcnew(type, std::forward(args)...); + static_assert(!is_sso_v); + return heap.gcnew(type, std::forward(args)...); } #endif