|
From: SourceForge.net <no...@so...> - 2009-11-14 15:19:09
|
Bugs item #2115237, was opened at 2008-09-17 01:32 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2115237&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: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Mark Gossage (mgossage) Assigned to: Nobody/Anonymous (nobody) Summary: const/non const typemaps Initial Comment: Given the interface %inline %{ struct T{}; %} %typemap(in) const T& " //TODO const T& in" %typemap(in,numinputs=0) T& " //TODO T& in" %typemap(argout) T& " //TODO T& argout" %inline %{ void fn1(const T&){} void fn2(T&){} %} Checking the wrappered code for many languages (Lua,Python,Java). The fn2() wrapper has //TODO T& in fn2(*arg1); //TODO T& argout As expected, but the fn1() has //TODO const T& in fn1((T const &)*arg1); //TODO T& argout Which means it matches the T& argout. It can be fixed with a extra typemap %typemap(argout) const T& "" So the bug is: should SWIG be matching a non const typemap to a const value? It doesn't happen the other way around (if you define the const T& typemap only) ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2009-11-14 15:19 Message: Hi Mark, This is expected behaviour and documented in the "Pattern matching rules" in the Typemaps chapter of the docs. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2115237&group_id=1645 |