diff options
author | Olly Betts <olly@survex.com> | 2011-03-14 12:33:56 +0000 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2011-03-14 12:33:56 +0000 |
commit | 72fc8be46c79953e2859a5a472df8a60b2e5cb02 (patch) | |
tree | b00f92b97f1690b78c06311f0792ce608b771e13 /Examples | |
parent | 5d765893ed7caa951db3059804cc4d761612d2f3 (diff) | |
download | swig-72fc8be46c79953e2859a5a472df8a60b2e5cb02.tar.gz |
[PHP] Fix handling of overloaded methods/functions where some
return void and others don't - whether this worked or not depended
on the order they were encountered in (SF#3208299).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12539 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/overload_return_type.i | 10 | ||||
-rw-r--r-- | Examples/test-suite/php/overload_return_type_runme.php | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Examples/test-suite/overload_return_type.i b/Examples/test-suite/overload_return_type.i index e6b3b130a..aa387a108 100644 --- a/Examples/test-suite/overload_return_type.i +++ b/Examples/test-suite/overload_return_type.i @@ -10,4 +10,14 @@ class B { int foo(int x) { return 0; } A foo(const char * y) { return A(); } }; + +// Regression test for PHP from SF#3208299 (there bar()'s return type wa +// treated as always void). + +void foo(int i) {} +int foo() { return 1; } + +int bar() { return 1; } +void bar(int i) {} + %} diff --git a/Examples/test-suite/php/overload_return_type_runme.php b/Examples/test-suite/php/overload_return_type_runme.php index 84979e6a1..4fa19d22a 100644 --- a/Examples/test-suite/php/overload_return_type_runme.php +++ b/Examples/test-suite/php/overload_return_type_runme.php @@ -7,4 +7,7 @@ $b = new B; check::equal($b->foo(1), 0, ""); check::classname("A", $b->foo("test")); +check::equal(overload_return_type::foo(), 1, "overload_return_type::foo() should be 1"); +check::equal(overload_return_type::bar(), 1, "overload_return_type::bar() should be 1"); + ?> |