make implicit conversions non-reentrant (fixes #1035) (#1037)
diff --git a/tests/test_class.py b/tests/test_class.py
index ac2a3c0..412d679 100644
--- a/tests/test_class.py
+++ b/tests/test_class.py
@@ -223,3 +223,13 @@
assert refcount_1 == refcount_3
assert refcount_2 > refcount_1
+
+
+def test_reentrant_implicit_conversion_failure(msg):
+ # ensure that there is no runaway reentrant implicit conversion (#1035)
+ with pytest.raises(TypeError) as excinfo:
+ m.BogusImplicitConversion(0)
+ assert msg(excinfo.value) == '''__init__(): incompatible constructor arguments. The following argument types are supported:
+ 1. m.class_.BogusImplicitConversion(arg0: m.class_.BogusImplicitConversion)
+
+Invoked with: 0'''