Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error in binding group" incorrectly thrown #611

Closed
natefaubion opened this issue Sep 25, 2014 · 2 comments
Closed

"Error in binding group" incorrectly thrown #611

natefaubion opened this issue Sep 25, 2014 · 2 comments
Assignees
Milestone

Comments

@natefaubion
Copy link
Contributor

module Foo where
foo = bar where bar r = r + 1
r = foo 2
Error at bad.purs line 3, column 5:
Error in binding group [foo,r]
foo may not be defined in the current scope.

The top-level r is conflicting with the r argument inside of foos where clause. It works if you change the argument name or top-level name to something else.

@paf31 paf31 added this to the 0.6.0 milestone Sep 25, 2014
@paf31
Copy link
Contributor

paf31 commented Sep 25, 2014

Adding this to 0.6, seems like it would be nice to have it fixed by then.

@paf31
Copy link
Contributor

paf31 commented Sep 25, 2014

If anyone wants to have a go at fixing this before I get to it, the issue is that these two functions should not be in the same binding group. The fix is to ignore shadowed names here:

https://github.com/purescript/purescript/blob/master/src/Language/PureScript/Sugar/BindingGroups.hs#L92

@paf31 paf31 self-assigned this Oct 15, 2014
@paf31 paf31 closed this as completed in 02a7452 Oct 15, 2014
paf31 added a commit that referenced this issue Oct 15, 2014
Fix #611 - do not take locally-bound names into account when calculating...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants