Allow function pointer extraction from overloaded functions (#2944)

* Add a failure test for overloaded functions

* Allow function pointer extraction from overloaded functions
This commit is contained in:
Tamaki Nishino
2021-04-14 08:53:56 +09:00
committed by GitHub
parent e0c1dadb75
commit 6709abba93
3 changed files with 17 additions and 5 deletions

View File

@@ -93,6 +93,10 @@ def test_cpp_function_roundtrip():
m.test_dummy_function(m.roundtrip(m.dummy_function))
== "matches dummy_function: eval(1) = 2"
)
assert (
m.test_dummy_function(m.dummy_function_overloaded)
== "matches dummy_function: eval(1) = 2"
)
assert m.roundtrip(None, expect_none=True) is None
assert (
m.test_dummy_function(lambda x: x + 2)