{"action":"opened","issue":{"url":"https://api.github.com/repos/numba/numba/issues/2719","repository_url":"https://api.github.com/repos/numba/numba","labels_url":"https://api.github.com/repos/numba/numba/issues/2719/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/2719/comments","events_url":"https://api.github.com/repos/numba/numba/issues/2719/events","html_url":"https://github.com/numba/numba/issues/2719","id":294458379,"number":2719,"title":"enhance variable scoping to allow refining types in branches","user":{"login":"sklam","id":1929845,"avatar_url":"https://avatars1.githubusercontent.com/u/1929845?v=4","gravatar_id":"","url":"https://api.github.com/users/sklam","html_url":"https://github.com/sklam","followers_url":"https://api.github.com/users/sklam/followers","following_url":"https://api.github.com/users/sklam/following{/other_user}","gists_url":"https://api.github.com/users/sklam/gists{/gist_id}","starred_url":"https://api.github.com/users/sklam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sklam/subscriptions","organizations_url":"https://api.github.com/users/sklam/orgs","repos_url":"https://api.github.com/users/sklam/repos","events_url":"https://api.github.com/users/sklam/events{/privacy}","received_events_url":"https://api.github.com/users/sklam/received_events","type":"User","site_admin":false},"labels":[{"id":971734,"url":"https://api.github.com/repos/numba/numba/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-05T16:35:17Z","updated_at":"2018-02-05T16:35:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This relates to the second issue in <https://github.com/numba/numba/pull/2672#issuecomment-363131354>.\r\n\r\nThe current variable scoping rules will only allow new variable definition on the [\"backbone\"](https://github.com/numba/numba/blob/d53fb10511f5aa72c2e449d003a8de9ecefa2bf9/numba/controlflow.py#L164-L170):\r\n\r\nhttps://github.com/numba/numba/blob/d53fb10511f5aa72c2e449d003a8de9ecefa2bf9/numba/controlflow.py#L164-L170\r\n\r\nVariables defined outside will always use the variable defined in the closest dominating block.  This makes certain variable type refinement code fail unexpectedly:\r\n\r\n```python\r\nout = <..define to be any layout .>\r\n if out.flags.c_contiguous:\r\n        out = np.ascontiguousarray(out)   \r\n       # out is still any layout despite the previous conversion\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"sklam"}}