{"action":"created","issue":{"url":"https://api.github.com/repos/hostilefork/rencpp/issues/52","labels_url":"https://api.github.com/repos/hostilefork/rencpp/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/hostilefork/rencpp/issues/52/comments","events_url":"https://api.github.com/repos/hostilefork/rencpp/issues/52/events","html_url":"https://github.com/hostilefork/rencpp/issues/52","id":54628329,"number":52,"title":"Improve error message on illegal casts","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars.githubusercontent.com/u/20440?v=3","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-16T21:40:22Z","updated_at":"2015-01-16T21:55:26Z","closed_at":null,"body":"If you write:\r\n\r\n    Integer value = 10;\r\n    Float illegalFloat = static_cast<Float>(value);\r\n\r\nThe error message that comes back says:\r\n\r\n> error: call of overloaded 'Float(ren::Integer&)' is ambiguous\r\n\r\nReally what it should say is \"you can't do that\".  *(Although whether you can do this specific case or not is up for debate in #7)*  Is there some static_assert or otherwise that could give a better message?"},"comment":{"url":"https://api.github.com/repos/hostilefork/rencpp/issues/comments/70328823","html_url":"https://github.com/hostilefork/rencpp/issues/52#issuecomment-70328823","issue_url":"https://api.github.com/repos/hostilefork/rencpp/issues/52","id":70328823,"user":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T21:55:26Z","updated_at":"2015-01-16T21:55:26Z","body":"Wouldn't `Float(Integer) = delete;` in `Float` be sufficient? It would probably result in a message along the lines of \"use of deleted constructor [...]\" while pointing to the deleted constructor and adding a \"required from here\" pointing to the line where the constructor was called. If you really want to inform the user, put some comment above the deleted constructor."}}