https://github.com/robinst/swig-ruby-subclass-namespace-problem
Example for SWIG Ruby problem with subclass in other namespace
https://github.com/robinst/swig-ruby-subclass-namespace-problem
Last synced: 10 months ago
JSON representation
Example for SWIG Ruby problem with subclass in other namespace
- Host: GitHub
- URL: https://github.com/robinst/swig-ruby-subclass-namespace-problem
- Owner: robinst
- Created: 2011-10-01T14:25:59.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-10-08T19:38:21.000Z (over 14 years ago)
- Last Synced: 2025-02-25T06:45:07.592Z (11 months ago)
- Language: Ruby
- Homepage:
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SWIG Ruby problem with subclass in other namespace
==================================================
This is an example showing a bug in SWIG Ruby, where the Ruby class is
wrong in the following situation:
module base.i:
class Foo::Bar;
module sub.i:
class Foo::Sub::Bar;
Foo::Bar *bar();
Foo::Sub::Bar *subbar();
Now, when calling `bar()` from Ruby, the Ruby class of the returned
object is `Foo::Sub::Bar`, where instead it should be `Foo::Bar`. The
class of `subbar()` is `Foo::Sub::Bar` (which is correct):
bar: Foo::Sub::Bar
subbar: Foo::Sub::Bar
Running the example
-------------------
To build and run the example, do the following:
./build.sh
ruby test.rb
Then have a look at the output.
You may have to configure the path to the SWIG binary in `build.sh`.