Call all_type_info_check_for_divergence() also from type_caster_generic::load_impl<>

This commit is contained in:
Ralf W. Grosse-Kunstleve
2023-11-07 08:45:52 -08:00
parent 9ae6cbaea1
commit 5f5fd6a68e
3 changed files with 25 additions and 3 deletions

View File

@@ -30,6 +30,12 @@ class PCD(PC1, PC2):
pass
class PCDI(PC1, PC2):
def __init__(self):
PC1.__init__(self, 11)
PC2.__init__(self, 12)
def test_PC():
d = PC(11)
assert d.get_base_value() == 11
@@ -69,3 +75,9 @@ def test_PCD():
match=r"CppDrvd2\.__init__\(\) must be called when overriding __init__$",
):
PCD(11)
def test_PCDI():
obj = PCDI()
with pytest.raises(TypeError, match="^bases include diverging derived types: "):
m.pass_CppBase(obj)