ariovistus / pyd

Interoperability between Python and D
MIT License
157 stars 32 forks source link

Revert "Fix another deprecation wrt. escaping `this`" #159

Closed kinke closed 2 years ago

kinke commented 2 years ago

This reverts commit d18d388b1bbf4ba9e50fec6e49087c13a40a2d6c.

This fixes this compilation error:

pyd/infrastructure/pyd/func_wrap.d(802,22): Error: cannot implicitly convert expression `fn` of type `RangeWrapper* function() return` to `RangeWrapper* function()`
pyd/infrastructure/pyd/func_wrap.d-mixin-405(407,33): Error: template instance `pyd.func_wrap.dg_wrapper!(RangeWrapper*, RangeWrapper* function() return)` error instantiating
pyd/infrastructure/pyd/func_wrap.d(364,19):        instantiated from here: `memberfunc_to_func!(RangeWrapper*, iter)`
pyd/infrastructure/pyd/class_wrap.d(311,48):        instantiated from here: `method_wrap!(RangeWrapper*, iter, "RangeWrapper.__iter__")`
pyd/infrastructure/pyd/class_wrap.d(1580,22):        instantiated from here: `call!("RangeWrapper", RangeWrapper*)`
pyd/infrastructure/pyd/class_wrap.d(1551,5):        instantiated from here: `_wrap_class!(RangeWrapper, "RangeWrapper", "", "pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
pyd/infrastructure/pyd/make_object.d(75,13):        instantiated from here: `wrap_struct!(RangeWrapper, ModuleName!"pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
pyd/infrastructure/pyd/func_wrap.d(247,29): Error: template instance `pyd.func_wrap.applyPyTupleToAlias!(func, "RangeWrapper.__iter__")` error instantiating
pyd/infrastructure/pyd/func_wrap.d(365,20):        instantiated from here: `pyApplyToAlias!(func, "RangeWrapper.__iter__")`
pyd/infrastructure/pyd/class_wrap.d(311,48):        instantiated from here: `method_wrap!(RangeWrapper*, iter, "RangeWrapper.__iter__")`
pyd/infrastructure/pyd/class_wrap.d(1580,22):        instantiated from here: `call!("RangeWrapper", RangeWrapper*)`
pyd/infrastructure/pyd/class_wrap.d(1551,5):        instantiated from here: `_wrap_class!(RangeWrapper, "RangeWrapper", "", "pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
pyd/infrastructure/pyd/make_object.d(75,13):        instantiated from here: `wrap_struct!(RangeWrapper, ModuleName!"pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
pyd/infrastructure/pyd/class_wrap.d(1356,29): Error: template instance `pyd.op_wrap.opiter_wrap!(RangeWrapper*, iter)` error instantiating
pyd/infrastructure/pyd/class_wrap.d(1634,26):        instantiated from here: `call!(RangeWrapper*)`
pyd/infrastructure/pyd/class_wrap.d(1551,5):        instantiated from here: `_wrap_class!(RangeWrapper, "RangeWrapper", "", "pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
pyd/infrastructure/pyd/make_object.d(75,13):        instantiated from here: `wrap_struct!(RangeWrapper, ModuleName!"pyd", Def!(iter, PyName!"__iter__"), Def!(next))`
kinke commented 2 years ago

This could probably be handled similar to https://github.com/ariovistus/pyd/blob/cb78f99f1853f0f14dbba950d7500d76cbeada63/infrastructure/pyd/func_wrap.d#L800 by casting away the return.

kinke commented 2 years ago

Thx and sorry for the trouble. A new tag would be even nicer. :)

ariovistus commented 2 years ago

0.14.2

kinke commented 2 years ago

Thx, much appreciated!