{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/5457","repository_url":"https://api.github.com/repos/D-Programming-Language/dmd","labels_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/5457/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/5457/comments","events_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/5457/events","html_url":"https://github.com/D-Programming-Language/dmd/pull/5457","id":133644811,"number":5457,"title":"refactor: replace cast with paint","user":{"login":"WalterBright","id":568298,"avatar_url":"https://avatars.githubusercontent.com/u/568298?v=3","gravatar_id":"","url":"https://api.github.com/users/WalterBright","html_url":"https://github.com/WalterBright","followers_url":"https://api.github.com/users/WalterBright/followers","following_url":"https://api.github.com/users/WalterBright/following{/other_user}","gists_url":"https://api.github.com/users/WalterBright/gists{/gist_id}","starred_url":"https://api.github.com/users/WalterBright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WalterBright/subscriptions","organizations_url":"https://api.github.com/users/WalterBright/orgs","repos_url":"https://api.github.com/users/WalterBright/repos","events_url":"https://api.github.com/users/WalterBright/events{/privacy}","received_events_url":"https://api.github.com/users/WalterBright/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-15T07:38:35Z","updated_at":"2016-02-15T07:55:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/5457","html_url":"https://github.com/D-Programming-Language/dmd/pull/5457","diff_url":"https://github.com/D-Programming-Language/dmd/pull/5457.diff","patch_url":"https://github.com/D-Programming-Language/dmd/pull/5457.patch"},"body":"The old C++ version of this code avoided dynamic_cast in favor of a direct cast with no checking. This was for performance reasons. The few places were dynamic_cast was needed are the isXXXXX() series of virtual functions. The D version does a dynamic cast, which is slow and involves function calls, etc.\r\n\r\nThis fixes that by introducing `paint` which does a dynamic cast for `debug` and a type paint otherwise. I included a sample of how it is to be used."},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/comments/184103589","html_url":"https://github.com/D-Programming-Language/dmd/pull/5457#issuecomment-184103589","issue_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/5457","id":184103589,"user":{"login":"yebblies","id":580100,"avatar_url":"https://avatars.githubusercontent.com/u/580100?v=3","gravatar_id":"","url":"https://api.github.com/users/yebblies","html_url":"https://github.com/yebblies","followers_url":"https://api.github.com/users/yebblies/followers","following_url":"https://api.github.com/users/yebblies/following{/other_user}","gists_url":"https://api.github.com/users/yebblies/gists{/gist_id}","starred_url":"https://api.github.com/users/yebblies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yebblies/subscriptions","organizations_url":"https://api.github.com/users/yebblies/orgs","repos_url":"https://api.github.com/users/yebblies/repos","events_url":"https://api.github.com/users/yebblies/events{/privacy}","received_events_url":"https://api.github.com/users/yebblies/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T07:55:21Z","updated_at":"2016-02-15T07:55:21Z","body":"This is incorrect, dynamic cast is not supported on `extern(C++)` classes and will instead do a type paint.  `extern(C++)` classes do not have built-in rtti."}}