From: SourceForge.net <no...@so...> - 2007-05-02 03:30:18
|
Bugs item #1488142, was opened at 2006-05-13 20:11 Message generated for change (Settings changed) made by gga73 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ruby Group: None >Status: Closed Resolution: None Priority: 7 Private: No Submitted By: Steve Sloan (c0de_m0nkey) Assigned to: cfis (cfis) >Summary: Can\'t overload bool/int Initial Comment: If a class has two constructors - one that takes a bool and another that takes an integer - only the bool constructor will ever be used. The issue is that SWIG_AsVal_bool will accept an integer and convert it to a bool, and since it has higher precedence than SWIG_AsVal_int, the later is never called. I've verified by removing bool's handling of ints. Since this may be undesirable (for backward compatibility), it should be possible to fix by changing the precedence order. ---------------------------------------------------------------------- Comment By: cfis (cfis) Date: 2006-07-15 16:20 Message: Logged In: YES user_id=1323508 Interesing question. Just posted a question to the devel list to ask how to proceed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 |
From: SourceForge.net <no...@so...> - 2007-10-25 20:10:03
|
Bugs item #1488142, was opened at 2006-05-13 16:11 Message generated for change (Settings changed) made by c0de_m0nkey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ruby Group: None >Status: Open Resolution: None Priority: 7 Private: No Submitted By: Steve Sloan (c0de_m0nkey) Assigned to: cfis (cfis) Summary: Can\'t overload bool/int Initial Comment: If a class has two constructors - one that takes a bool and another that takes an integer - only the bool constructor will ever be used. The issue is that SWIG_AsVal_bool will accept an integer and convert it to a bool, and since it has higher precedence than SWIG_AsVal_int, the later is never called. I've verified by removing bool's handling of ints. Since this may be undesirable (for backward compatibility), it should be possible to fix by changing the precedence order. ---------------------------------------------------------------------- >Comment By: Steve Sloan (c0de_m0nkey) Date: 2007-10-25 13:09 Message: Logged In: YES user_id=1128361 Originator: YES What's up with this bug? Still in the latest release, and it's blocking proper wrapper generation for BDB/XML. ---------------------------------------------------------------------- Comment By: cfis (cfis) Date: 2006-07-15 12:20 Message: Logged In: YES user_id=1323508 Interesing question. Just posted a question to the devel list to ask how to proceed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 |
From: SourceForge.net <no...@so...> - 2007-10-25 20:49:28
|
Bugs item #1488142, was opened at 2006-05-13 20:11 Message generated for change (Comment added) made by gga73 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ruby Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Steve Sloan (c0de_m0nkey) Assigned to: cfis (cfis) Summary: Can\'t overload bool/int Initial Comment: If a class has two constructors - one that takes a bool and another that takes an integer - only the bool constructor will ever be used. The issue is that SWIG_AsVal_bool will accept an integer and convert it to a bool, and since it has higher precedence than SWIG_AsVal_int, the later is never called. I've verified by removing bool's handling of ints. Since this may be undesirable (for backward compatibility), it should be possible to fix by changing the precedence order. ---------------------------------------------------------------------- >Comment By: Gonzalo Garramuno (gga73) Date: 2007-10-25 17:49 Message: Logged In: YES user_id=961712 Originator: NO This bug was fixed in SVN. This corresponds to swig v1.3.32. There has not been a swig release in a year, but the bug should be fixed. If you compiled from SVN and still see the problem, please provide a simple example if you can and platform information. --- bool_int.swg %module bool_int %inline { int func( bool x ) { printf( "bool\n" ); return 0; } int func( int x ) { printf( "int\n" ); return 0; } } --------------- > swig -ruby -c++ bool_int.swig > g++ bool_int_wrap.cxx -I /usr/lib/ruby/1.8/x86_64-linux/ -L/usr/lib/ruby/1.8/x86_64-linux/ -lruby1.8 > irb irb> require 'bool_int' irb> include Bool_int irb> func( 10.0 ) ArgumentError: Wrong arguments for overloaded method 'func'. Possible C/C++ prototypes are: int func(bool x) int func(int x) irb> func( 10 ) int irb> func( false ) bool from (irb):4:in `func' from (irb):4 ---------------------------------------------------------------------- Comment By: Steve Sloan (c0de_m0nkey) Date: 2007-10-25 17:09 Message: Logged In: YES user_id=1128361 Originator: YES What's up with this bug? Still in the latest release, and it's blocking proper wrapper generation for BDB/XML. ---------------------------------------------------------------------- Comment By: cfis (cfis) Date: 2006-07-15 16:20 Message: Logged In: YES user_id=1323508 Interesing question. Just posted a question to the devel list to ask how to proceed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 |
From: SourceForge.net <no...@so...> - 2007-10-26 17:46:00
|
Bugs item #1488142, was opened at 2006-05-13 16:11 Message generated for change (Comment added) made by c0de_m0nkey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ruby Group: None >Status: Closed Resolution: None Priority: 7 Private: No Submitted By: Steve Sloan (c0de_m0nkey) Assigned to: cfis (cfis) Summary: Can\'t overload bool/int Initial Comment: If a class has two constructors - one that takes a bool and another that takes an integer - only the bool constructor will ever be used. The issue is that SWIG_AsVal_bool will accept an integer and convert it to a bool, and since it has higher precedence than SWIG_AsVal_int, the later is never called. I've verified by removing bool's handling of ints. Since this may be undesirable (for backward compatibility), it should be possible to fix by changing the precedence order. ---------------------------------------------------------------------- >Comment By: Steve Sloan (c0de_m0nkey) Date: 2007-10-26 10:45 Message: Logged In: YES user_id=1128361 Originator: YES Confirmed fixed in SVN, thanks. ---------------------------------------------------------------------- Comment By: Gonzalo Garramuno (gga73) Date: 2007-10-25 13:49 Message: Logged In: YES user_id=961712 Originator: NO This bug was fixed in SVN. This corresponds to swig v1.3.32. There has not been a swig release in a year, but the bug should be fixed. If you compiled from SVN and still see the problem, please provide a simple example if you can and platform information. --- bool_int.swg %module bool_int %inline { int func( bool x ) { printf( "bool\n" ); return 0; } int func( int x ) { printf( "int\n" ); return 0; } } --------------- > swig -ruby -c++ bool_int.swig > g++ bool_int_wrap.cxx -I /usr/lib/ruby/1.8/x86_64-linux/ -L/usr/lib/ruby/1.8/x86_64-linux/ -lruby1.8 > irb irb> require 'bool_int' irb> include Bool_int irb> func( 10.0 ) ArgumentError: Wrong arguments for overloaded method 'func'. Possible C/C++ prototypes are: int func(bool x) int func(int x) irb> func( 10 ) int irb> func( false ) bool from (irb):4:in `func' from (irb):4 ---------------------------------------------------------------------- Comment By: Steve Sloan (c0de_m0nkey) Date: 2007-10-25 13:09 Message: Logged In: YES user_id=1128361 Originator: YES What's up with this bug? Still in the latest release, and it's blocking proper wrapper generation for BDB/XML. ---------------------------------------------------------------------- Comment By: cfis (cfis) Date: 2006-07-15 12:20 Message: Logged In: YES user_id=1323508 Interesing question. Just posted a question to the devel list to ask how to proceed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1488142&group_id=1645 |