{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/444","repository_url":"https://api.github.com/repos/HaxeFoundation/hxcpp","labels_url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/444/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/444/comments","events_url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/444/events","html_url":"https://github.com/HaxeFoundation/hxcpp/issues/444","id":153423400,"number":444,"title":"No cpp::Pointer_obj::fromRaw(cpp::RawAutoCast) on haxe 3.2.1","user":{"login":"ibilon","id":3843471,"avatar_url":"https://avatars.githubusercontent.com/u/3843471?v=3","gravatar_id":"","url":"https://api.github.com/users/ibilon","html_url":"https://github.com/ibilon","followers_url":"https://api.github.com/users/ibilon/followers","following_url":"https://api.github.com/users/ibilon/following{/other_user}","gists_url":"https://api.github.com/users/ibilon/gists{/gist_id}","starred_url":"https://api.github.com/users/ibilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibilon/subscriptions","organizations_url":"https://api.github.com/users/ibilon/orgs","repos_url":"https://api.github.com/users/ibilon/repos","events_url":"https://api.github.com/users/ibilon/events{/privacy}","received_events_url":"https://api.github.com/users/ibilon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T10:27:05Z","updated_at":"2016-05-15T15:31:02Z","closed_at":null,"body":"Changed code from `Pointer.fromRaw(untyped __cpp__(\"(wxTextCtrl*)(_ref->get_raw())\"));` to the lot nicer `Pointer.fromRaw(_ref.rawCast());`.\r\n\r\nBut this code\r\n```\r\nprivate function get_textCtrlRef():Pointer<WxTextCtrl> {\r\n    return Pointer.fromRaw(_ref.rawCast());\r\n}\r\n```\r\n(with `_ref` a `Pointer<WxWindow>` and `WxWindow` a parent class of `WxTextCtrl`)\r\n\r\nfails on c++ compilation with\r\n```\r\n./src/hx/widgets/TextCtrl.cpp:183:87: error: no matching function for call to ‘cpp::Pointer_obj::fromRaw(cpp::RawAutoCast)’\r\n\r\n./src/hx/widgets/TextCtrl.cpp:183:87: note: candidates are:\r\n\r\n/home/travis/build/ianharrigan/hxWidgets/hxcpp/include/cpp/Pointer.h:487:27: note: template<class T> static cpp::Pointer<T> cpp::Pointer_obj::fromRaw(T*)\r\n\r\n/home/travis/build/ianharrigan/hxWidgets/hxcpp/include/cpp/Pointer.h:489:27: note: template<class T> static cpp::Pointer<T> cpp::Pointer_obj::fromRaw(const T*)\r\n```\r\n\r\non haxe 3.2.1, works on 3.3."},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/comments/219292368","html_url":"https://github.com/HaxeFoundation/hxcpp/issues/444#issuecomment-219292368","issue_url":"https://api.github.com/repos/HaxeFoundation/hxcpp/issues/444","id":219292368,"user":{"login":"ibilon","id":3843471,"avatar_url":"https://avatars.githubusercontent.com/u/3843471?v=3","gravatar_id":"","url":"https://api.github.com/users/ibilon","html_url":"https://github.com/ibilon","followers_url":"https://api.github.com/users/ibilon/followers","following_url":"https://api.github.com/users/ibilon/following{/other_user}","gists_url":"https://api.github.com/users/ibilon/gists{/gist_id}","starred_url":"https://api.github.com/users/ibilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibilon/subscriptions","organizations_url":"https://api.github.com/users/ibilon/orgs","repos_url":"https://api.github.com/users/ibilon/repos","events_url":"https://api.github.com/users/ibilon/events{/privacy}","received_events_url":"https://api.github.com/users/ibilon/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T15:31:02Z","updated_at":"2016-05-15T15:31:02Z","body":"Looking into it, no luck yet, I can't find in `cpp::Pointer`, `cpp::Pointer_obj` or `cpp::RawAutoCast` anything related to this and the haxe version.\r\n\r\nBut made a small test case:\r\n```haxe\r\nimport cpp.Pointer;\r\nimport cpp.RawPointer;\r\n\r\n@:headerCode(\"\r\nclass Parent {\r\npublic:\r\n\tParent() { }\r\n};\r\n\r\nclass Child : public Parent {\r\npublic:\r\n\tChild():Parent() { }\r\n};\r\n\")\r\nclass Test {\r\n\tpublic static function main() {\r\n\t\tvar c = Pointer.fromRaw(Child._new());\r\n\t\tvar p = conv(c);\r\n\t}\r\n\r\n\tstatic inline function conv(c:Pointer<Child>):Pointer<Parent> {\r\n\t\treturn Pointer.fromRaw(c.rawCast());\r\n\t}\r\n}\r\n\r\nextern class Parent {\r\n\t@:native(\"new Parent\") public static function _new():RawPointer<Parent>;\r\n}\r\n\r\nextern class Child extends Parent {\r\n\t@:native(\"new Child\") public static function _new():RawPointer<Child>;\r\n}\r\n```"}}