Warn instead of stopping on misplaced Haddock comments
|Reported by:||Fuuzetsu||Owned by:|
|Type of failure:||Incorrect warning at compile-time||Test Case:|
|Related Tickets:||Differential Rev(s):||Phab:D452|
Given a simple module like
module H where data F = F () -- ^ Comment for first type argument ()
and trying to run Haddock on it, we'll get back
/tmp/H.hs:4:12: parse error on input ‘(’
The error message is rather sub-par in this scenario. It'd be great if we could instead print a warning saying that a Haddock comment is unexpected in that position and then continue on parsing.
Best case scenario would be a more informative message such as “Documenting each constructor argument is not supported” but that might be quite a bit harder.
Filing on GHC Trac as it's the parser that needs changing I believe.