From 5a6ede01d141c00d9b17e35c117508d2cb1fbfb0 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 16 Jun 2024 22:42:45 +0800 Subject: [PATCH] fix new_object<> --- include/pocketpy/interpreter/vm.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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