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

Nested reducers are not properly handled by type checker #947

Closed
PaulKlint opened this issue Apr 13, 2016 · 3 comments
Closed

Nested reducers are not properly handled by type checker #947

PaulKlint opened this issue Apr 13, 2016 · 3 comments

Comments

@PaulKlint
Copy link
Member

int wordCount(list[str] lines) = (0 | it + (0 | it + 1 | /\w+/ := line) | str line <- lines);

test bool wordCount1() = wordCount(["Andra moi ennepe,", "Mousa, polutropon,", "hos mala polla "]) == 8;

Is correct but gives the following type error:

Cannot re-declare name that is already declared in the current function or closure: it

[I have added this as test to ReducerTests]

@mahills
Copy link
Member

mahills commented Apr 13, 2016

I should be able to fix this fairly easily. I'll take a look...

@PaulKlint
Copy link
Member Author

Thanks @mahills! These are the wonders of documentation-based testing: I am currently rewriting the Tutor to work with the compiler and compile and execute all Rascal fragments in our documentation. This is why this came up today.

@PaulKlint
Copy link
Member Author

Great!

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