Fixes infinite loop due to () brackets in a non-type template
parameter containing an expression
Fixes#2418
Non-trivial expressions are still not qualified properly though.
Further switch to use rtypecheck typemaps instead of hard coded logic.
The full switch to typemaps is deferred until swig-4.2 as it can't be fully
backwards compatible. For now a warning is provided to help the
transition. It provides the full typemap that should be placed into
a user's interface file, for example:
%typemap("rtype") int32_t * "integer"
void testmethod(int32_t * i);
void testmethod();
If there is no rtypecheck typemap for int32_t *, the warning shown is:
example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
following typemap to fix as the next version of SWIG will not work without it:
%typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}
The warning is shown for any code that previously used "numeric", "integer" or
"character" for the rtype typemap. Copying the rtypecheck typemap as
shown into the user interface file will provide the appropriate fix and
the warning will disappear. This is important to do as swig-4.2 will
not be able to provide this helpful warning.
- Fix for special variable $argtype expansion in rtypecheck typemap.
- Remove unnecessary () brackets when using rtypecheck typemap for
single parameter functions.
- Add rtypecheck typemaps for shared_ptr so that NULL can be used
in overloaded functions taking shared_ptr.
when incorrect types passed are passed to the overloaded methods.
Old unhelpful error message:
Error in f(...) : could not find function "f"
Example of new improved error message:
Error in use_count(k) :
cannot find overloaded function for use_count with argtypes (NULL)
- swig library files must be installed relatively to the exe into PREFIX/bin/Lib
- unset SWIG_LIB_WIN_UNIX else swiglib returns a list of 2 paths which
break cmake detection (and consistent to the provided windows binaries)
* rfix-cleaned-up:
Whitespace cleanup in R testcase
R shared_ptr fixes
align implementation of smartname to r class name
enable test for pointerreftest fixed by 752b7e8
switched implementation reference from java to python
fixes from code review
enable li_boost_shared_ptr in r-test-suite
typo in comment
fix naming of RClass when template of a shared_ptr
Fix problems in shared_ptr wrappers where the class names were
not consistent when using the shared_ptr template or the actual
underlying type. Move $R_class substitution to typemaps.
Issue #2386
Add support for special variable replacement in the $typemap()
special variable macro for R specific typemaps (rtype, rtypecheck,
scoercein, scoereout).
This reverts commit ea514c3961.
The new runme.js isn't used for node because it fails to run
multicpptest testcases, but was failing for jsc in CI.
The first problem is the new file is missing `new` where the two
objects are created, but fixing that reveals that this testcase
is currently broken for Javascript so just revert for now.
Look up unknown base classes using SWIG_MangledTypeQueryModule().
Revert to using SWIG_TypeCheck() instead of SWIG_TypeCheckStruct()
as the latter doesn't seem to work for this case (at least for PHP
right now).
Add mod_runme.php as a regression test for this.
Adjust the PHP test harness not to set up reflection for the module
unless it's actually needed for a testcase. Currently the approach
to find the module name doesn't work for multi-module testcases.
See #2126