{"action":"created","comment":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/29656977","id":29656977,"diff_hunk":"@@ -2761,6 +2761,29 @@ Expression *Expression::toBoolean(Scope *sc)\n             goto Lagain;\n         }\n     }\n+    // Other non-scalar types that are valid for bool conditions\n+    // should have their contents lowered to valid scalars.\n+    else if (tb->ty == Tarray)","path":"src/expression.c","position":6,"original_position":6,"commit_id":"00a4117c5c25667c69dbbc9a8950643446c31472","original_commit_id":"00a4117c5c25667c69dbbc9a8950643446c31472","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},"body":"You could always update magicport to accept it properly, the source is in master!","created_at":"2015-05-05T10:14:44Z","updated_at":"2015-05-05T10:14:44Z","html_url":"https://github.com/D-Programming-Language/dmd/pull/4630#discussion_r29656977","pull_request_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/29656977"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4630#discussion_r29656977"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630"}}},"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630","id":34632033,"html_url":"https://github.com/D-Programming-Language/dmd/pull/4630","diff_url":"https://github.com/D-Programming-Language/dmd/pull/4630.diff","patch_url":"https://github.com/D-Programming-Language/dmd/pull/4630.patch","issue_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4630","number":4630,"state":"open","locked":false,"title":"Issue 14534: Lower non-scalar types valid in a boolean context in the front-end","user":{"login":"ibuclaw","id":397929,"avatar_url":"https://avatars.githubusercontent.com/u/397929?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuclaw","html_url":"https://github.com/ibuclaw","followers_url":"https://api.github.com/users/ibuclaw/followers","following_url":"https://api.github.com/users/ibuclaw/following{/other_user}","gists_url":"https://api.github.com/users/ibuclaw/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuclaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuclaw/subscriptions","organizations_url":"https://api.github.com/users/ibuclaw/orgs","repos_url":"https://api.github.com/users/ibuclaw/repos","events_url":"https://api.github.com/users/ibuclaw/events{/privacy}","received_events_url":"https://api.github.com/users/ibuclaw/received_events","type":"User","site_admin":false},"body":"As per: https://issues.dlang.org/show_bug.cgi?id=14534 - does the lowering of non-scalar boolean conditions allowed in D to valid scalar values.\r\n\r\nThis may be a deviation from what GDC/LDC/DMD *actually* does.  But seems to correlate with what people *expected*.  ie: People were generally surprised when I mentioned that GDC lowers ``if (arr)`` and ``if (dg)`` to ``(arr.ptr | arr.length)`` and ``(dg.ptr | dg.funcptr)`` respectively.  Though in the edge case where an expression is evaluated true where the user might expect false, there is some serious circumvention going on at runtime.\r\n\r\nThis bypasses going through DotIdExp - I did have a check and couldn't see any stand out reason to do so.","created_at":"2015-05-04T12:03:22Z","updated_at":"2015-05-05T10:14:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bbcb48778e21e055d160f6a43231cc345eb2791","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630/commits","review_comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630/comments","review_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4630/comments","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/00a4117c5c25667c69dbbc9a8950643446c31472","head":{"label":"ibuclaw:issue14534","ref":"issue14534","sha":"00a4117c5c25667c69dbbc9a8950643446c31472","user":{"login":"ibuclaw","id":397929,"avatar_url":"https://avatars.githubusercontent.com/u/397929?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuclaw","html_url":"https://github.com/ibuclaw","followers_url":"https://api.github.com/users/ibuclaw/followers","following_url":"https://api.github.com/users/ibuclaw/following{/other_user}","gists_url":"https://api.github.com/users/ibuclaw/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuclaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuclaw/subscriptions","organizations_url":"https://api.github.com/users/ibuclaw/orgs","repos_url":"https://api.github.com/users/ibuclaw/repos","events_url":"https://api.github.com/users/ibuclaw/events{/privacy}","received_events_url":"https://api.github.com/users/ibuclaw/received_events","type":"User","site_admin":false},"repo":{"id":1653829,"name":"dmd","full_name":"ibuclaw/dmd","owner":{"login":"ibuclaw","id":397929,"avatar_url":"https://avatars.githubusercontent.com/u/397929?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuclaw","html_url":"https://github.com/ibuclaw","followers_url":"https://api.github.com/users/ibuclaw/followers","following_url":"https://api.github.com/users/ibuclaw/following{/other_user}","gists_url":"https://api.github.com/users/ibuclaw/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuclaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuclaw/subscriptions","organizations_url":"https://api.github.com/users/ibuclaw/orgs","repos_url":"https://api.github.com/users/ibuclaw/repos","events_url":"https://api.github.com/users/ibuclaw/events{/privacy}","received_events_url":"https://api.github.com/users/ibuclaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ibuclaw/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/ibuclaw/dmd","forks_url":"https://api.github.com/repos/ibuclaw/dmd/forks","keys_url":"https://api.github.com/repos/ibuclaw/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ibuclaw/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ibuclaw/dmd/teams","hooks_url":"https://api.github.com/repos/ibuclaw/dmd/hooks","issue_events_url":"https://api.github.com/repos/ibuclaw/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/ibuclaw/dmd/events","assignees_url":"https://api.github.com/repos/ibuclaw/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/ibuclaw/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/ibuclaw/dmd/tags","blobs_url":"https://api.github.com/repos/ibuclaw/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ibuclaw/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ibuclaw/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/ibuclaw/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ibuclaw/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/ibuclaw/dmd/languages","stargazers_url":"https://api.github.com/repos/ibuclaw/dmd/stargazers","contributors_url":"https://api.github.com/repos/ibuclaw/dmd/contributors","subscribers_url":"https://api.github.com/repos/ibuclaw/dmd/subscribers","subscription_url":"https://api.github.com/repos/ibuclaw/dmd/subscription","commits_url":"https://api.github.com/repos/ibuclaw/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/ibuclaw/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/ibuclaw/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/ibuclaw/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/ibuclaw/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/ibuclaw/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ibuclaw/dmd/merges","archive_url":"https://api.github.com/repos/ibuclaw/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ibuclaw/dmd/downloads","issues_url":"https://api.github.com/repos/ibuclaw/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/ibuclaw/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/ibuclaw/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/ibuclaw/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ibuclaw/dmd/labels{/name}","releases_url":"https://api.github.com/repos/ibuclaw/dmd/releases{/id}","created_at":"2011-04-23T15:21:22Z","updated_at":"2015-04-26T09:18:12Z","pushed_at":"2015-05-04T11:49:19Z","git_url":"git://github.com/ibuclaw/dmd.git","ssh_url":"git@github.com:ibuclaw/dmd.git","clone_url":"https://github.com/ibuclaw/dmd.git","svn_url":"https://github.com/ibuclaw/dmd","homepage":"d-programming-language.org","size":51318,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"D-Programming-Language:master","ref":"master","sha":"b9dee9e4d845b6ee30b4ac63886531dae200a760","user":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"D-Programming-Language/dmd","owner":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/D-Programming-Language/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/D-Programming-Language/dmd","forks_url":"https://api.github.com/repos/D-Programming-Language/dmd/forks","keys_url":"https://api.github.com/repos/D-Programming-Language/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Programming-Language/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Programming-Language/dmd/teams","hooks_url":"https://api.github.com/repos/D-Programming-Language/dmd/hooks","issue_events_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/D-Programming-Language/dmd/events","assignees_url":"https://api.github.com/repos/D-Programming-Language/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/D-Programming-Language/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/tags","blobs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Programming-Language/dmd/languages","stargazers_url":"https://api.github.com/repos/D-Programming-Language/dmd/stargazers","contributors_url":"https://api.github.com/repos/D-Programming-Language/dmd/contributors","subscribers_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscribers","subscription_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscription","commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/D-Programming-Language/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/D-Programming-Language/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Programming-Language/dmd/merges","archive_url":"https://api.github.com/repos/D-Programming-Language/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Programming-Language/dmd/downloads","issues_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Programming-Language/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Programming-Language/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Programming-Language/dmd/labels{/name}","releases_url":"https://api.github.com/repos/D-Programming-Language/dmd/releases{/id}","created_at":"2011-01-15T06:53:53Z","updated_at":"2015-05-05T09:40:30Z","pushed_at":"2015-05-05T09:40:30Z","git_url":"git://github.com/D-Programming-Language/dmd.git","ssh_url":"git@github.com:D-Programming-Language/dmd.git","clone_url":"https://github.com/D-Programming-Language/dmd.git","svn_url":"https://github.com/D-Programming-Language/dmd","homepage":"dlang.org","size":95672,"stargazers_count":988,"watchers_count":988,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":323,"mirror_url":null,"open_issues_count":84,"forks":323,"open_issues":84,"watchers":988,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4630"},"issue":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4630"},"comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4630/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4630/commits"},"statuses":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/00a4117c5c25667c69dbbc9a8950643446c31472"}}}}