{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/2477","labels_url":"https://api.github.com/repos/babel/babel/issues/2477/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/2477/comments","events_url":"https://api.github.com/repos/babel/babel/issues/2477/events","html_url":"https://github.com/babel/babel/issues/2477","id":109546621,"number":2477,"title":"Error using type cast expression with yield expression ","user":{"login":"gabelevi","id":1887264,"avatar_url":"https://avatars.githubusercontent.com/u/1887264?v=3","gravatar_id":"","url":"https://api.github.com/users/gabelevi","html_url":"https://github.com/gabelevi","followers_url":"https://api.github.com/users/gabelevi/followers","following_url":"https://api.github.com/users/gabelevi/following{/other_user}","gists_url":"https://api.github.com/users/gabelevi/gists{/gist_id}","starred_url":"https://api.github.com/users/gabelevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabelevi/subscriptions","organizations_url":"https://api.github.com/users/gabelevi/orgs","repos_url":"https://api.github.com/users/gabelevi/repos","events_url":"https://api.github.com/users/gabelevi/events{/privacy}","received_events_url":"https://api.github.com/users/gabelevi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-02T18:30:31Z","updated_at":"2015-10-04T02:53:18Z","closed_at":null,"body":"The repro looks like\r\n\r\n```JavaScript\r\nfunction *test() {\r\n  ((yield 4): number);\r\n}\r\n```\r\n\r\nWhen I try the repl, I get `repl: unknown Expression of type \"TypeCastExpression\"`\r\n\r\nOn a related note I believe\r\n\r\n```JavaScript\r\n(yield 4: number);\r\n```\r\n\r\nshould parse, but it doesn't."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/145312229","html_url":"https://github.com/babel/babel/issues/2477#issuecomment-145312229","issue_url":"https://api.github.com/repos/babel/babel/issues/2477","id":145312229,"user":{"login":"splodingsocks","id":1227109,"avatar_url":"https://avatars.githubusercontent.com/u/1227109?v=3","gravatar_id":"","url":"https://api.github.com/users/splodingsocks","html_url":"https://github.com/splodingsocks","followers_url":"https://api.github.com/users/splodingsocks/followers","following_url":"https://api.github.com/users/splodingsocks/following{/other_user}","gists_url":"https://api.github.com/users/splodingsocks/gists{/gist_id}","starred_url":"https://api.github.com/users/splodingsocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splodingsocks/subscriptions","organizations_url":"https://api.github.com/users/splodingsocks/orgs","repos_url":"https://api.github.com/users/splodingsocks/repos","events_url":"https://api.github.com/users/splodingsocks/events{/privacy}","received_events_url":"https://api.github.com/users/splodingsocks/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T02:53:18Z","updated_at":"2015-10-04T02:53:18Z","body":"I put a log statement inside of the function I liked above. The log statement is reached with I have the yield commented out (for line 3):\r\n\r\n```javascript\r\nfunction *test() {\r\n  var a: string;\r\n  a = ('a': string);\r\n  // ((yield 4): number);\r\n}\r\n```\r\n\r\nBut when I uncomment line 4, the log statement never gets reached. This suggests to me that regenerator is running before the flow annotations get stripped. I'm looking around the code to see if I can find where the order of those operations is defined, but it's not immediately obvious to me. Can anyone point me in the right direction?\r\n"}}