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

Added exhaustiveness check to src/ir/AST/Util.hs #145

Closed
wants to merge 3 commits into from
Closed

Added exhaustiveness check to src/ir/AST/Util.hs #145

wants to merge 3 commits into from

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented Apr 27, 2015

This commit fixes issues #138 and #139, which were caused by missing
cases in the utility functions for AST. This commit also makes GHC
produce an error if a new AST node is added without the proper cases in
Util.hs, preventing these kinds of mistakes again. To make this work
there can be no "catch all" cases in the functions getChildren and
putChildren. This inconvenience is outweighed by the fact that we are
guaranteed to never forget adding a case for our new AST nodes.

I borrowed the test case from @kikofernandez earlier pull request (that I rejected).

This commit fixes issues #138 and #139, which were caused by missing
cases in the utility functions for AST. This commit also makes GHC
produce an error if a new AST node is added without the proper cases in
`Util.hs`, preventing these kinds of mistakes again. To make this work
there can be no "catch all" cases in the functions `getChildren` and
`putChildren`. This inconvenience is outweighed by the fact that we are
guaranteed to never forget adding a case for our new AST nodes.
This commit fixes issues #138 and #139, which were caused by missing
cases in the utility functions for AST. This commit also makes GHC
produce an error if a new AST node is added without the proper cases in
`Util.hs`, preventing these kinds of mistakes again. To make this work
there can be no "catch all" cases in the functions `getChildren` and
`putChildren`. This inconvenience is outweighed by the fact that we are
guaranteed to never forget adding a case for our new AST nodes.
@kikofernandez kikofernandez self-assigned this Apr 27, 2015
@kikofernandez
Copy link
Contributor

Hi there, I was wondering why do you have 3 commits, when 2 of them seem to be the same and the last is not relevant to the PR. I believe you are working on your master branch in your fork. Whenever you pull from upstream and push to origin (your fork), the PR gets those changes as well. In order to solve this, create a new branch and put the commit that you want to create as PR. Push to origin and create the PR again. I don't think there's an easy way to refactor this, since it's linked to your master's fork.

@EliasC
Copy link
Contributor Author

EliasC commented Apr 27, 2015

You are very right, I tried rebasing upstream after submitting the pull request. Will redo!

@EliasC EliasC closed this Apr 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants