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

Placing a haddock line inbetween the module declaration and the imports results in a parse error #251

Closed
appestat opened this issue Feb 18, 2020 · 2 comments · Fixed by #255

Comments

@appestat
Copy link

appestat commented Feb 18, 2020

module Error where
-- | test
import Prelude

results in a parse error in GHC, while

module Error where
-- test
import Prelude

does not. Furthermore,

module Error where
-- | test

also does not produce an error.
This is related to #167, but this is just a haddock line and not anything doctest specific. If it's not possible to fix like #167 should this be added to the readme as well?
Output of doctest --version:

doctest version 0.16.2
using version 8.6.5 of the GHC API
using /usr/local/Cellar/ghc/8.6.5/bin/ghc-8.6.5
@quasicomputational
Copy link
Collaborator

That haddock placement also breaks haddock in the same way.

Do you think it makes sense to document that doctest requires your comments to be legal according to haddock? That requirement makes sense to me, and chances are that you don't want broken haddocks anyway.

@appestat
Copy link
Author

I think that's totally reasonable, yeah. Thanks!

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 a pull request may close this issue.

2 participants