{"action":"created","issue":{"url":"https://api.github.com/repos/somebee/imba/issues/2","labels_url":"https://api.github.com/repos/somebee/imba/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/somebee/imba/issues/2/comments","events_url":"https://api.github.com/repos/somebee/imba/issues/2/events","html_url":"https://github.com/somebee/imba/issues/2","id":98974492,"number":2,"title":"If-expression inside tags gets wrong cache key","user":{"login":"judofyr","id":499,"avatar_url":"https://avatars.githubusercontent.com/u/499?v=3","gravatar_id":"","url":"https://api.github.com/users/judofyr","html_url":"https://github.com/judofyr","followers_url":"https://api.github.com/users/judofyr/followers","following_url":"https://api.github.com/users/judofyr/following{/other_user}","gists_url":"https://api.github.com/users/judofyr/gists{/gist_id}","starred_url":"https://api.github.com/users/judofyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/judofyr/subscriptions","organizations_url":"https://api.github.com/users/judofyr/orgs","repos_url":"https://api.github.com/users/judofyr/repos","events_url":"https://api.github.com/users/judofyr/events{/privacy}","received_events_url":"https://api.github.com/users/judofyr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/somebee/imba/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-08-04T13:47:41Z","updated_at":"2015-08-04T15:50:21Z","closed_at":"2015-08-04T15:09:40Z","body":"```imba\r\ntag foo\r\n  def render\r\n    <self>\r\n      if true\r\n        <h3> \"hello\"\r\n        <h3> \"world\"\r\n```\r\n\r\nCompiles to:\r\n\r\n```javascript\r\nreturn this.setChildren((true) && (\r\n\t[(this[-1] = this[-1] || t$('h3')).setContent(\"hello\").end(),\r\n\t(this[-1] = this[-1] || t$('h3')).setContent(\"world\").end()\r\n\t]\r\n)).synced();\r\n```\r\n\r\nThe error seems to be caused by the key being chosen by `var key = parent.tree.indexOf(self)`, and `self` isn't a children of the `foo`-tree."},"comment":{"url":"https://api.github.com/repos/somebee/imba/issues/comments/127656260","html_url":"https://github.com/somebee/imba/issues/2#issuecomment-127656260","issue_url":"https://api.github.com/repos/somebee/imba/issues/2","id":127656260,"user":{"login":"judofyr","id":499,"avatar_url":"https://avatars.githubusercontent.com/u/499?v=3","gravatar_id":"","url":"https://api.github.com/users/judofyr","html_url":"https://github.com/judofyr","followers_url":"https://api.github.com/users/judofyr/followers","following_url":"https://api.github.com/users/judofyr/following{/other_user}","gists_url":"https://api.github.com/users/judofyr/gists{/gist_id}","starred_url":"https://api.github.com/users/judofyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/judofyr/subscriptions","organizations_url":"https://api.github.com/users/judofyr/orgs","repos_url":"https://api.github.com/users/judofyr/repos","events_url":"https://api.github.com/users/judofyr/events{/privacy}","received_events_url":"https://api.github.com/users/judofyr/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T15:50:21Z","updated_at":"2015-08-04T15:50:21Z","body":"`<post@key>` should probably be disallowed in loops. I don't see any way for it to make any sense inside a loop. One solution is to make `<post@key>` and `<post@{key}>` more distinct: We could make `<post@{key}>` is only for caching and not for access (e.g. it sets an ivar named `\"_hidden_\"+key` or something). That way, you don't expect `<post@{key}>` inside a loop to be accessible."}}