{"action":"created","issue":{"url":"https://api.github.com/repos/jesserayadkins/lily/issues/249","repository_url":"https://api.github.com/repos/jesserayadkins/lily","labels_url":"https://api.github.com/repos/jesserayadkins/lily/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/jesserayadkins/lily/issues/249/comments","events_url":"https://api.github.com/repos/jesserayadkins/lily/issues/249/events","html_url":"https://github.com/jesserayadkins/lily/issues/249","id":165080561,"number":249,"title":"Unclear error message: \"SyntaxError: Statement(s) after 'return' will not execute.\"","user":{"login":"a-p-","id":4145331,"avatar_url":"https://avatars.githubusercontent.com/u/4145331?v=3","gravatar_id":"","url":"https://api.github.com/users/a-p-","html_url":"https://github.com/a-p-","followers_url":"https://api.github.com/users/a-p-/followers","following_url":"https://api.github.com/users/a-p-/following{/other_user}","gists_url":"https://api.github.com/users/a-p-/gists{/gist_id}","starred_url":"https://api.github.com/users/a-p-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-p-/subscriptions","organizations_url":"https://api.github.com/users/a-p-/orgs","repos_url":"https://api.github.com/users/a-p-/repos","events_url":"https://api.github.com/users/a-p-/events{/privacy}","received_events_url":"https://api.github.com/users/a-p-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-12T13:29:18Z","updated_at":"2016-07-12T21:54:25Z","closed_at":null,"body":"Code like below, which was intended to return a value but where the function's return type was accidentally omitted:\r\n\r\n    define test { return 0 }\r\n\r\ncauses lily (1df03d72ab747f1fc4d4c927e06e56cf1363d82a) to give an error message like:\r\n\r\n    $ ../../build/lily return.lly \r\n    SyntaxError: Statement(s) after 'return' will not execute.\r\n        from return.lly:1\r\n    $\r\n\r\nIt runs without giving an error message after specifying the function's return type:\r\n\r\n    define test: Integer { return 0 }\r\n\r\nMaybe that error message should hint that the function's return type might be unintentionally missing?\r\n\r\nWas also initially confused by how it refers to \"Statements(s) after 'return'\", although in a case like this the return statement is the last one. Guess I was considering the return's expression to be part of the return statement itself, rather than a separate statement following it."},"comment":{"url":"https://api.github.com/repos/jesserayadkins/lily/issues/comments/232193707","html_url":"https://github.com/jesserayadkins/lily/issues/249#issuecomment-232193707","issue_url":"https://api.github.com/repos/jesserayadkins/lily/issues/249","id":232193707,"user":{"login":"jesserayadkins","id":7182625,"avatar_url":"https://avatars.githubusercontent.com/u/7182625?v=3","gravatar_id":"","url":"https://api.github.com/users/jesserayadkins","html_url":"https://github.com/jesserayadkins","followers_url":"https://api.github.com/users/jesserayadkins/followers","following_url":"https://api.github.com/users/jesserayadkins/following{/other_user}","gists_url":"https://api.github.com/users/jesserayadkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jesserayadkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesserayadkins/subscriptions","organizations_url":"https://api.github.com/users/jesserayadkins/orgs","repos_url":"https://api.github.com/users/jesserayadkins/repos","events_url":"https://api.github.com/users/jesserayadkins/events{/privacy}","received_events_url":"https://api.github.com/users/jesserayadkins/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T21:54:24Z","updated_at":"2016-07-12T21:54:24Z","body":"I've hit this a couple of times in the past, but wasn't sure what a good terse error message would be. How about `\"(Missing return?) Statement(s) after 'return' will not execute.\"`, with the aim being that parentheses at the front draws the attention toward the problem?"}}
{"actor":{"display_login":"jesserayadkins"}}