{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/811","labels_url":"https://api.github.com/repos/facebook/flow/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/811/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/811/events","html_url":"https://github.com/facebook/flow/issues/811","id":107041560,"number":811,"title":"Failure(\"Did not expect BoundT\")","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-17T18:16:31Z","updated_at":"2015-09-18T22:03:00Z","closed_at":null,"body":"I run into the following issue:\r\n\r\n```\r\n/Users/gozala/Projects/reflex/src/core.js: Library type error:\r\n/Users/gozala/Projects/reflex/src/core.js:\r\nFailure(\"Did not expect BoundT\")\r\n```\r\n\r\nCurrent state of that file is https://gist.github.com/Gozala/46a0f1665182e47bf82b, I'll try to reduce the content to figure make it easier."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/141580075","html_url":"https://github.com/facebook/flow/issues/811#issuecomment-141580075","issue_url":"https://api.github.com/repos/facebook/flow/issues/811","id":141580075,"user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T22:02:59Z","updated_at":"2015-09-18T22:02:59Z","body":"I tried another thing in the meantime but now I get a lot of type is incompatible with union type errors:\r\n\r\n```js\r\n/* @flow */\r\n\r\ntype RecatNode = ReactElement<any,any,any>;\r\nclass VirtualNode {\r\n  tagName: string;\r\n  properties: {[key:string]: any};\r\n  attributes: {[key:string]: string};\r\n  children: Children;\r\n  constructor(tagName, properties, attributes, children) {\r\n    this.tagName = tagName;\r\n    this.properties = properties;\r\n    this.attributes = attributes;\r\n    this.children = children\r\n  }\r\n}\r\n\r\nclass TextNode {\r\n  content: string;\r\n  constructor(content) {\r\n    this.content = content\r\n  }\r\n}\r\n\r\nvar text = (content:any) => new TextNode(String(content))\r\nvar node = (tagName, properties, children) =>\r\n  new VirtualNode(tagName,\r\n                  properties != null ? properties : {},\r\n                  {},\r\n                  children != null ? children  : []);\r\n\r\ntype VirtualElement\r\n  = TextNode\r\n  | ReactNode\r\n  | VirtualNode\r\n  | ThunkNode$0\r\n  | ThunkNode$1\r\n  | ThunkNode$2;\r\n\r\n\r\ntype Children = Array<VirtualElement>;\r\n\r\ntype Args$0 = [];\r\ntype Args$1 <A> = [A];\r\ntype Args$2 <A, B> = [A, B];\r\ntype Args$$ = Array<any>;\r\n\r\ntype View$0 = () => VirtualElement;\r\ntype View$1 <A> = (a:A) => VirtualElement;\r\ntype View$2 <A,B> = (a:A, b:B) => VirtualElement;\r\n\r\ntype View$$ = (a:any, b:any, c:any, ...args:Array<any>) => VirtualElement;\r\n\r\n\r\ntype Props <View, Args> = {\r\n  key:string;\r\n  view:View;\r\n  args:Args;\r\n};\r\n\r\n\r\nclass ThunkNode {\r\n  props: Props<Function, Array<any>>;\r\n  constructor(key, view, args) {\r\n    this.props = {key, view, args}\r\n  }\r\n  force() {\r\n    return this.props.view(...this.props.args)\r\n  }\r\n}\r\n\r\nclass ThunkNode$0 extends ThunkNode {\r\n  props: Props<View$0, Args$0>;\r\n}\r\n\r\nclass ThunkNode$1 <A> extends ThunkNode {\r\n  props: Props<View$1<A>, Args$1<A>>;\r\n}\r\n\r\nclass ThunkNode$2 <A, B> extends ThunkNode {\r\n  props: Props<View$2<A,B>, Args$2<A, B>>;\r\n}\r\n\r\n\r\ntype ThunkFactory <A, B>\r\n  = (key:string, view:View$0) => ThunkNode$0\r\n  | <A> (key:string, view:View$1, a:A) => ThunkNode$1<A>\r\n  | <A, B> (key:string, view:View$2, a:A, b:B) => ThunkNode$2<A,B>;\r\n\r\nvar thunkFactory = (key:string, view:View, ...args) =>\r\n  args.length === 0 ? new ThunkNode$0(key, view, args) :\r\n  args.length === 1 ? new ThunkNode$1(key, view, args) :\r\n  args.length === 2 ? new ThunkNode$2(key, view, args) :\r\n  new ThunkNode$2(key, view, [args[0], args[1]]);\r\n\r\nvar thunk = (thunkFactory:ThunkFactory<any,any>);\r\n\r\nvar view = (value:number, address:Function) => node('div', {\r\n  key: 'counter'\r\n}, [\r\n  node('div', null, [text(value)]),\r\n  node('button', {\r\n    onClick: address\r\n  }, [text(\"click\")])\r\n]);\r\n\r\n\r\nview(4, alert);\r\nthunk(\"counter\", view, 4, alert);\r\nthunk(\"counter\", view, \"hi\", alert);\r\n```\r\n\r\nAt this point I'm ready to give up as I can't thing of any other way to express it."}}