From 93ef42e1d026c8a79f557705704b5c9559b6bc62 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 9 May 2023 14:30:08 +0800 Subject: [PATCH] fix #73 --- src/vm.h | 2 +- tests/40_class.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vm.h b/src/vm.h index dc87394c..0f5e0de3 100644 --- a/src/vm.h +++ b/src/vm.h @@ -286,7 +286,7 @@ public: template void bind_default_constructor(__T&& type) { - bind_constructor<1>(std::forward<__T>(type), [](VM* vm, ArgsView args){ + bind_constructor<-1>(std::forward<__T>(type), [](VM* vm, ArgsView args){ Type t = OBJ_GET(Type, args[0]); return vm->heap.gcnew(t, T()); }); diff --git a/tests/40_class.py b/tests/40_class.py index 5fb7176d..8f63850d 100644 --- a/tests/40_class.py +++ b/tests/40_class.py @@ -91,3 +91,11 @@ class B(A): # assert B.a == 1 ...bug here assert B.b == 3 assert B.c == 4 + +from c import void_p + +class A(void_p): + pass + +a = A() +assert repr(a) == '' \ No newline at end of file