Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Parse error with multiple where clauses #64

Closed
brianhv opened this issue Apr 10, 2012 · 2 comments
Closed

Parse error with multiple where clauses #64

brianhv opened this issue Apr 10, 2012 · 2 comments

Comments

@brianhv
Copy link

brianhv commented Apr 10, 2012

The following code compiles in ghc 7.2.1.

foo :: Int -> Int
foo x = x + y where
    y = z where
    z = 2

main :: IO ()
main = do
    print $ foo 2
    return ()

ghc-mod check reports no errors, but ghc-mod lint produces the cryptic:

%ghc-mod lint minerror.hs
minerror.hs:6:1: Parse errorError message:  Parse error: ;Code:        z = 2      > main :: IO ()    main = do        print $ foo 2

Removing the second where from foo eliminates the parse error. I would expect the above code to either produce no error from lint, or to complain about the second where rather than showing a parse error in an unrelated location.

@kazu-yamamoto
Copy link
Collaborator

If this is a really problem, please ask the author of hlint. ghc-mod just executes hlint and uses its result.

@brianhv
Copy link
Author

brianhv commented Apr 11, 2012

For anyone coming across this in a search, it appears this has already been reported upstream, as well as even more upstream.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants