{"action":"closed","issue":{"url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/634","repository_url":"https://api.github.com/repos/Whiley/WhileyCompiler","labels_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/634/labels{/name}","comments_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/634/comments","events_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/634/events","html_url":"https://github.com/Whiley/WhileyCompiler/issues/634","id":150560449,"number":634,"title":"Variable declarantions yield parse errors (headless statements and definite types)","user":{"login":"SebastianS90","id":7740744,"avatar_url":"https://avatars.githubusercontent.com/u/7740744?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianS90","html_url":"https://github.com/SebastianS90","followers_url":"https://api.github.com/users/SebastianS90/followers","following_url":"https://api.github.com/users/SebastianS90/following{/other_user}","gists_url":"https://api.github.com/users/SebastianS90/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianS90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianS90/subscriptions","organizations_url":"https://api.github.com/users/SebastianS90/orgs","repos_url":"https://api.github.com/users/SebastianS90/repos","events_url":"https://api.github.com/users/SebastianS90/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianS90/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-23T14:33:07Z","updated_at":"2016-04-25T22:26:50Z","closed_at":"2016-04-25T22:26:50Z","body":"This program does not compile. \"unrecognized term\" for for the `function` keyword.\r\n\r\n````\r\ntype myint is int\r\n\r\npublic export method test():\r\n    function()->(myint) m = &(-> 1)\r\n````\r\n\r\nThe same holds for methods.\r\n\r\nThe problem is that we end up being [here](https://github.com/Whiley/WhileyCompiler/blob/2cc45f5daea97b638d0f6bd801972a3b3cd160c8/modules/wyc/src/wyc/io/WhileyFileParser.java#L677) after `parseDefiniteType` returns `null` because `mustParseAsType` thinks we could parse it as expression.\r\n\r\nWhy not return `true` [here](https://github.com/Whiley/WhileyCompiler/blob/2cc45f5daea97b638d0f6bd801972a3b3cd160c8/modules/wyc/src/wyc/io/WhileyFileParser.java#L3377)? I cannot think of an expression that starts with a `function` or `method` keyword."}}