mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 21:10:19 +00:00
fix #73
This commit is contained in:
parent
515321a0af
commit
93ef42e1d0
2
src/vm.h
2
src/vm.h
@ -286,7 +286,7 @@ public:
|
|||||||
|
|
||||||
template<typename T, typename __T>
|
template<typename T, typename __T>
|
||||||
void bind_default_constructor(__T&& type) {
|
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]);
|
Type t = OBJ_GET(Type, args[0]);
|
||||||
return vm->heap.gcnew<T>(t, T());
|
return vm->heap.gcnew<T>(t, T());
|
||||||
});
|
});
|
||||||
|
@ -91,3 +91,11 @@ class B(A):
|
|||||||
# assert B.a == 1 ...bug here
|
# assert B.a == 1 ...bug here
|
||||||
assert B.b == 3
|
assert B.b == 3
|
||||||
assert B.c == 4
|
assert B.c == 4
|
||||||
|
|
||||||
|
from c import void_p
|
||||||
|
|
||||||
|
class A(void_p):
|
||||||
|
pass
|
||||||
|
|
||||||
|
a = A()
|
||||||
|
assert repr(a) == '<void* at (nil)>'
|
Loading…
x
Reference in New Issue
Block a user