using static narrow methods instead of %extended ones.

now it looks more natural and similar to the CORBA downcasting mechanism.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5587 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-12-23 10:10:04 +00:00
commit a152fd46a8
4 changed files with 56 additions and 37 deletions

View file

@ -15,15 +15,20 @@ if d.get() != dc.get():
if i.get() != ic.get():
raise RuntimeError
virtual_poly.incr(ic)
if (i.get() + 1) != ic.get():
raise RuntimeError
#
# here this dynamic_cast is not needed at all,
# but works fine anyway ('nnumber()' returns a NNumber).
# 'narrowing' also works
#
ddc = virtual_poly.NDouble_dynamic_cast(dc.nnumber())
ddc = virtual_poly.NDouble_narrow(d.nnumber())
if d.get() != ddc.get():
raise RuntimeError
dic = virtual_poly.NInt_dynamic_cast(ic.nnumber())
dic = virtual_poly.NInt_narrow(i.nnumber())
if i.get() != dic.get():
raise RuntimeError