Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEnhance is check for module object #381
Conversation
|
That probably requires a reverse-dependency check but I am traveling right now and may not get to it for some time. |
|
please take your time. we have applied a local specialization patch to our package for now. Thanks |
|
BTW, maybe you can add a simple test in https://github.com/RcppCore/Rcpp/tree/master/inst/unitTests/testRcppModule/src |
|
+1 for adding unit test support to this (or any, really) pull request. |
|
This does not seem like the right change. I think the only reason you're getting punted into the module method is because you haven't let Rcpp understand how to handle Please read https://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf for more information on how you can let (I could be wrong -- but my understanding is that if you have the appropriate architecture set up, the |
|
A very simple example to make things clear. Just use our
If other things pass into this function, we will get a warning, since @tqchen thought we need to check whether it is |
|
I think @thirdwing explains my point. Ideally it would be great For example, we can use this to check if input parameter is a certain type, and give more friendly error message to the user. void dosomething(Rcpp::List param_list) {
for (size_t i = 0; i < param_list.size(); ++i) {
if (!Rcpp::is<RcppModuleClassA>(param_list[i]))
throw Rcpp::exception("The input is expected to be list of RcppModuleClassA")
}
} |
|
Thanks, it indeed looks like the |
|
Agreed -- will merge now and launch a full reverse-dependency test. We can always revert should something bubble up (which we have no reason to expect). |
Enhance is check for module object
fix to #380