{"action":"created","issue":{"url":"https://api.github.com/repos/brownplt/pyret-lang/issues/562","labels_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/562/labels{/name}","comments_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/562/comments","events_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/562/events","html_url":"https://github.com/brownplt/pyret-lang/issues/562","id":105121625,"number":562,"title":"shadowing function makes where/check block failed","user":{"login":"sorawee","id":9099577,"avatar_url":"https://avatars.githubusercontent.com/u/9099577?v=3","gravatar_id":"","url":"https://api.github.com/users/sorawee","html_url":"https://github.com/sorawee","followers_url":"https://api.github.com/users/sorawee/followers","following_url":"https://api.github.com/users/sorawee/following{/other_user}","gists_url":"https://api.github.com/users/sorawee/gists{/gist_id}","starred_url":"https://api.github.com/users/sorawee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorawee/subscriptions","organizations_url":"https://api.github.com/users/sorawee/orgs","repos_url":"https://api.github.com/users/sorawee/repos","events_url":"https://api.github.com/users/sorawee/events{/privacy}","received_events_url":"https://api.github.com/users/sorawee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-06T22:56:01Z","updated_at":"2015-10-18T18:36:21Z","closed_at":null,"body":"I guess it makes sense, except that it could cause a confusion that why shadowing could affect code above it.\r\n\r\n```\r\nfun test(a, b):\r\n  a + b\r\nwhere:\r\n  test(1, 2) is 3\r\nend\r\n\r\nprint(test(1, 2)) #=> 3\r\n\r\nshadow test = test(_, 0)\r\n```\r\n\r\nresults in:\r\n\r\n```\r\n3\r\n\r\nExpected to get 1 argument at ...\r\nbut got these 2 arguments:\r\n```"},"comment":{"url":"https://api.github.com/repos/brownplt/pyret-lang/issues/comments/149037372","html_url":"https://github.com/brownplt/pyret-lang/issues/562#issuecomment-149037372","issue_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/562","id":149037372,"user":{"login":"jpolitz","id":119891,"avatar_url":"https://avatars.githubusercontent.com/u/119891?v=3","gravatar_id":"","url":"https://api.github.com/users/jpolitz","html_url":"https://github.com/jpolitz","followers_url":"https://api.github.com/users/jpolitz/followers","following_url":"https://api.github.com/users/jpolitz/following{/other_user}","gists_url":"https://api.github.com/users/jpolitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpolitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpolitz/subscriptions","organizations_url":"https://api.github.com/users/jpolitz/orgs","repos_url":"https://api.github.com/users/jpolitz/repos","events_url":"https://api.github.com/users/jpolitz/events{/privacy}","received_events_url":"https://api.github.com/users/jpolitz/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T18:36:21Z","updated_at":"2015-10-18T18:36:21Z","body":"Thanks.  This may be an annoying fix – I don't see a way to do this without moving scope resolution to before check block desugaring.  I'm not sure what that affects.\r\n\r\nInteresting overall that scope resolution clearly needs to be pushed as close to the beginning of desugaring as possible.  Obvious in retrospect (since we have all of @justinpombrio's research to tell us we'll make mistakes otherwise), but still interesting."}}