[R] Fix CopyToR() generated for struct in namespace
Fixes https://sourceforge.net/p/swig/bugs/1147/
This commit is contained in:
parent
25f996a5c8
commit
7813793511
5 changed files with 25 additions and 1 deletions
|
|
@ -315,6 +315,7 @@ CPP_TEST_CASES += \
|
|||
namespace_forward_declaration \
|
||||
namespace_nested \
|
||||
namespace_spaces \
|
||||
namespace_struct \
|
||||
namespace_template \
|
||||
namespace_typedef_class \
|
||||
namespace_typemap \
|
||||
|
|
|
|||
8
Examples/test-suite/namespace_struct.i
Normal file
8
Examples/test-suite/namespace_struct.i
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%module namespace_struct
|
||||
|
||||
%inline %{
|
||||
|
||||
// SWIG/R generated bad code for copyToR for a struct in a namespace in SWIG < 4.1.0
|
||||
namespace X { struct Y { int x, y; }; }
|
||||
|
||||
%}
|
||||
11
Examples/test-suite/r/namespace_struct_runme.R
Normal file
11
Examples/test-suite/r/namespace_struct_runme.R
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
|
||||
dyn.load(paste("namespace_struct", .Platform$dynlib.ext, sep=""))
|
||||
source("namespace_struct.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
xy = Y()
|
||||
xy$x = as.integer(2)
|
||||
xy$y = as.integer(4)
|
||||
copyToR(xy)
|
||||
Loading…
Add table
Add a link
Reference in a new issue