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

Poor error messaging for syntax errors inside type class and instance declarations #2128

Closed
bmjames opened this issue May 15, 2016 · 0 comments · Fixed by #2144
Closed

Poor error messaging for syntax errors inside type class and instance declarations #2128

bmjames opened this issue May 15, 2016 · 0 comments · Fixed by #2144

Comments

@bmjames
Copy link
Contributor

bmjames commented May 15, 2016

I am using psc version 0.8.5.0. It seems that whenever I make a syntax error inside of a type class or instance declaration, the error message is always the same:

Unable to parse module:
unexpected "where"
expecting no indentation or end of input

and the location of the where keyword is given, not the location of my syntax error, which may be several lines below.

Here is a minimal example:

module Main where

class Foo a where
  foo :: a -> !!!

Compiling with psc produces:

C:\Users\Ben\purescript\hello-world>psc src\Main.purs
Error found:
at C:\Users\Ben\purescript\hello-world\src\Main.purs line 3, column 13 - line 3, column 13

  Unable to parse module:
  unexpected "where"
  expecting no indentation or end of input

This is not helpful for finding the real syntax error, which was on line 4.

@paf31 paf31 added this to the 0.10.0 milestone May 15, 2016
@paf31 paf31 mentioned this issue May 23, 2016
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants