{"action":"created","issue":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/380","labels_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/380/comments","events_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/380/events","html_url":"https://github.com/RcppCore/Rcpp/issues/380","id":110510818,"number":380,"title":"is__module_object leads to error when checking non-module object","user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars.githubusercontent.com/u/2577440?v=3","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-08T18:10:57Z","updated_at":"2015-10-15T13:53:40Z","closed_at":"2015-10-15T13:53:40Z","body":"```c++\r\n#include <Rcpp.h>\r\n\r\nusing namespace Rcpp;\r\n\r\nclass MyClass{\r\n};\r\n\r\nRCPP_EXPORT_CALSS(MyClass)\r\n\r\n// [[Rcpp::export]]\r\nbool check(RObject m)\r\n{\r\n    return is<MyClass>(m);\r\n}\r\n\r\nRCPP_MODULE(test) {\r\n     class_<MyClass>(\"MyClass\");\r\n}\r\n```\r\nIf we call check from R's side by passing in a non-module object. It will report error \"External pointer is expected\", instead of returning false. \r\n\r\nThe problem is here https://github.com/RcppCore/Rcpp/blob/0a43747be6c7b88fec6717a45034e2749012dddf/inst/include/Rcpp/api/meat/is.h#L153\r\n\r\nMaybe need a explicit check of ext ptr type first before converting to XPtr"},"comment":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/comments/148393611","html_url":"https://github.com/RcppCore/Rcpp/issues/380#issuecomment-148393611","issue_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/380","id":148393611,"user":{"login":"thirdwing","id":1547093,"avatar_url":"https://avatars.githubusercontent.com/u/1547093?v=3","gravatar_id":"","url":"https://api.github.com/users/thirdwing","html_url":"https://github.com/thirdwing","followers_url":"https://api.github.com/users/thirdwing/followers","following_url":"https://api.github.com/users/thirdwing/following{/other_user}","gists_url":"https://api.github.com/users/thirdwing/gists{/gist_id}","starred_url":"https://api.github.com/users/thirdwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thirdwing/subscriptions","organizations_url":"https://api.github.com/users/thirdwing/orgs","repos_url":"https://api.github.com/users/thirdwing/repos","events_url":"https://api.github.com/users/thirdwing/events{/privacy}","received_events_url":"https://api.github.com/users/thirdwing/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T13:53:40Z","updated_at":"2015-10-15T13:53:40Z","body":"Fixed in #381 "}}