{"action":"created","issue":{"url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/536","labels_url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/536/labels{/name}","comments_url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/536/comments","events_url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/536/events","html_url":"https://github.com/hhvm/hack-hhvm-docs/issues/536","id":68044300,"number":536,"title":"Bug in hack.annotations.generators.php","user":{"login":"Sander-Toonen","id":5106372,"avatar_url":"https://avatars.githubusercontent.com/u/5106372?v=3","gravatar_id":"","url":"https://api.github.com/users/Sander-Toonen","html_url":"https://github.com/Sander-Toonen","followers_url":"https://api.github.com/users/Sander-Toonen/followers","following_url":"https://api.github.com/users/Sander-Toonen/following{/other_user}","gists_url":"https://api.github.com/users/Sander-Toonen/gists{/gist_id}","starred_url":"https://api.github.com/users/Sander-Toonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sander-Toonen/subscriptions","organizations_url":"https://api.github.com/users/Sander-Toonen/orgs","repos_url":"https://api.github.com/users/Sander-Toonen/repos","events_url":"https://api.github.com/users/Sander-Toonen/events{/privacy}","received_events_url":"https://api.github.com/users/Sander-Toonen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/labels/Hi%20Pri","name":"Hi Pri","color":"ff0000"},{"url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/labels/Incorrect","name":"Incorrect","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"SiebelsTim","id":1153003,"avatar_url":"https://avatars.githubusercontent.com/u/1153003?v=3","gravatar_id":"","url":"https://api.github.com/users/SiebelsTim","html_url":"https://github.com/SiebelsTim","followers_url":"https://api.github.com/users/SiebelsTim/followers","following_url":"https://api.github.com/users/SiebelsTim/following{/other_user}","gists_url":"https://api.github.com/users/SiebelsTim/gists{/gist_id}","starred_url":"https://api.github.com/users/SiebelsTim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SiebelsTim/subscriptions","organizations_url":"https://api.github.com/users/SiebelsTim/orgs","repos_url":"https://api.github.com/users/SiebelsTim/repos","events_url":"https://api.github.com/users/SiebelsTim/events{/privacy}","received_events_url":"https://api.github.com/users/SiebelsTim/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-04-13T08:48:11Z","updated_at":"2015-04-14T08:13:25Z","closed_at":null,"body":"When running ```hh_client``` on the source code example of the generator function I get the following output:\r\n\r\n````\r\n./test.php:4:3,7: Invalid yield (Typing[4110])\r\n./test.php:3:17,28: This is an object of type Continuation\r\n  ./test.php:4:3,7: It is incompatible with an object of type Generator (result of function with 'yield' in the body)\r\n````\r\nHowever, using Generator as return type does not solve the problem. What is the correct way of typing a generator function?\r\n\r\nVersion info:\r\n````\r\n$ hh_client --version\r\nee54f360eac1f3dcb2fa6755931031d82c6e0ac9 Feb 19 2015 02:07:29\r\n````"},"comment":{"url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/comments/92689182","html_url":"https://github.com/hhvm/hack-hhvm-docs/issues/536#issuecomment-92689182","issue_url":"https://api.github.com/repos/hhvm/hack-hhvm-docs/issues/536","id":92689182,"user":{"login":"Sander-Toonen","id":5106372,"avatar_url":"https://avatars.githubusercontent.com/u/5106372?v=3","gravatar_id":"","url":"https://api.github.com/users/Sander-Toonen","html_url":"https://github.com/Sander-Toonen","followers_url":"https://api.github.com/users/Sander-Toonen/followers","following_url":"https://api.github.com/users/Sander-Toonen/following{/other_user}","gists_url":"https://api.github.com/users/Sander-Toonen/gists{/gist_id}","starred_url":"https://api.github.com/users/Sander-Toonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sander-Toonen/subscriptions","organizations_url":"https://api.github.com/users/Sander-Toonen/orgs","repos_url":"https://api.github.com/users/Sander-Toonen/repos","events_url":"https://api.github.com/users/Sander-Toonen/events{/privacy}","received_events_url":"https://api.github.com/users/Sander-Toonen/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T08:13:25Z","updated_at":"2015-04-14T08:13:25Z","body":"Thank you @SiebelsTim and @jwatzman. I'm not sure I get why ```$r``` needs to be typed in your example but using ```\\Generator<int, string, void>``` for a function yielding strings did the trick."}}