Added a simple example where the current universal

Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.

They are two runtime examples: one for java, which is
failing, and one for python, which works fine.

Detailed description of the case can be found
in the three files committed.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-12-22 06:26:44 +00:00
commit c85521c002
3 changed files with 172 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import virtual_poly
d = virtual_poly.NDouble(3.5)
i = virtual_poly.NInt(2)
dc = d.copy()
ic = i.copy()
if d.get() != dc.get():
raise RuntimeError
if i.get() != ic.get():
raise RuntimeError
ddc = virtual_poly.NDouble_dynamic_cast(dc)
if d.get() != ddc.get():
raise RuntimeError