{"action":"closed","issue":{"url":"https://api.github.com/repos/ziglang/zig/issues/2121","repository_url":"https://api.github.com/repos/ziglang/zig","labels_url":"https://api.github.com/repos/ziglang/zig/issues/2121/labels{/name}","comments_url":"https://api.github.com/repos/ziglang/zig/issues/2121/comments","events_url":"https://api.github.com/repos/ziglang/zig/issues/2121/events","html_url":"https://github.com/ziglang/zig/issues/2121","id":426636526,"node_id":"MDU6SXNzdWU0MjY2MzY1MjY=","number":2121,"title":"@bswap() and @bitreverse() should not implicitely cast","user":{"login":"shawnl","id":510834,"node_id":"MDQ6VXNlcjUxMDgzNA==","avatar_url":"https://avatars1.githubusercontent.com/u/510834?v=4","gravatar_id":"","url":"https://api.github.com/users/shawnl","html_url":"https://github.com/shawnl","followers_url":"https://api.github.com/users/shawnl/followers","following_url":"https://api.github.com/users/shawnl/following{/other_user}","gists_url":"https://api.github.com/users/shawnl/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnl/subscriptions","organizations_url":"https://api.github.com/users/shawnl/orgs","repos_url":"https://api.github.com/users/shawnl/repos","events_url":"https://api.github.com/users/shawnl/events{/privacy}","received_events_url":"https://api.github.com/users/shawnl/received_events","type":"User","site_admin":false},"labels":[{"id":693800736,"node_id":"MDU6TGFiZWw2OTM4MDA3MzY=","url":"https://api.github.com/repos/ziglang/zig/labels/proposal","name":"proposal","color":"aaefdc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ziglang/zig/milestones/7","html_url":"https://github.com/ziglang/zig/milestone/7","labels_url":"https://api.github.com/repos/ziglang/zig/milestones/7/labels","id":3696526,"node_id":"MDk6TWlsZXN0b25lMzY5NjUyNg==","number":7,"title":"0.5.0","description":"Accept and resolve these issues, reject, or postpone them before releasing 0.5.0.","creator":{"login":"andrewrk","id":106511,"node_id":"MDQ6VXNlcjEwNjUxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/106511?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewrk","html_url":"https://github.com/andrewrk","followers_url":"https://api.github.com/users/andrewrk/followers","following_url":"https://api.github.com/users/andrewrk/following{/other_user}","gists_url":"https://api.github.com/users/andrewrk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewrk/subscriptions","organizations_url":"https://api.github.com/users/andrewrk/orgs","repos_url":"https://api.github.com/users/andrewrk/repos","events_url":"https://api.github.com/users/andrewrk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewrk/received_events","type":"User","site_admin":false},"open_issues":484,"closed_issues":28,"state":"open","created_at":"2018-09-28T13:04:50Z","updated_at":"2019-04-30T18:09:02Z","due_on":"2019-09-30T07:00:00Z","closed_at":null},"comments":16,"created_at":"2019-03-28T18:06:48Z","updated_at":"2019-04-30T18:09:02Z","closed_at":"2019-04-30T18:09:02Z","author_association":"CONTRIBUTOR","body":"These implicit casts change the results, which goes against the philosophy of implicit casts.\r\nfrom the documentation:\r\n```\r\nImplicit casts are only allowed when it is completely unambiguous\r\nhow to get from one type to another, and the transformation is\r\nguaranteed to be safe. <=====\r\n```\r\nSee #2119 for more discussion.\r\n\r\nOh, we still need this implicit cast:\r\n```\r\n    // cast from typed number to integer or float literal.\r\n    // works when the number is known at compile time\r\n    if (instr_is_comptime(value) &&\r\n        ((actual_type->id == ZigTypeIdInt && wanted_type->id == ZigTypeIdComptimeInt) ||\r\n        (actual_type->id == ZigTypeIdFloat && wanted_type->id == ZigTypeIdComptimeFloat)))\r\n    {\r\n        return ir_analyze_number_to_literal(ira, source_instr, value, wanted_type);\r\n    }\r\n```\r\nand this one:\r\n```\r\n    // cast from undefined to anything\r\n    if (actual_type->id == ZigTypeIdUndefined) {\r\n        return ir_analyze_undefined_to_anything(ira, source_instr, value, wanted_type);\r\n    }\r\n```\r\n"}}
{"actor":{"display_login":"andrewrk"}}