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

Matching methods with no pattern crashes the compiler #440

Closed
EliasC opened this issue May 24, 2016 · 2 comments
Closed

Matching methods with no pattern crashes the compiler #440

EliasC opened this issue May 24, 2016 · 2 comments

Comments

@EliasC
Copy link
Contributor

EliasC commented May 24, 2016

The following short program crashes the compiler

class Foo
  def

encorec: Prelude.head: empty list

It seems like the def is interpreted as an empty list of matching method headers. My guess is changing sepBy to sepBy1 (or similar) in the parser is enough to fix it.

@EliasC EliasC added the bug label May 24, 2016
@EliasC EliasC assigned ghost May 24, 2016
@ghost
Copy link

ghost commented May 24, 2016

Yeah sepBy1 fixes it. However, writing tests for failing programs is quite tricky atm and will probably be much easier in the future after the test scripts have been refactored. Should I submit a PR without tests, or shall I dig into how the failing tests in the typeSym folder work?

@EliasC
Copy link
Contributor Author

EliasC commented May 24, 2016

IMO, it's not worth the extra work to write test scripts if they're being replaced soon anyway.

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

No branches or pull requests

2 participants