
#9672: Error message too long (full case statement printed) -------------------------------------+------------------------------------- Reporter: | Owner: andreas.abel | Status: new Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: (Type checker) | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: Other | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): Sadly error messages are (ultimately) `Pretty.Doc`s, and we currently lack a way to ask how long they are. Actually that might not be a hard thing to add; one could simply add up the length of the strings in the `Doc` (which is a data structure. That would not tell you how much white space would be printed (you'd have to render it for that), but it would tell you how much payload there was. There is also a currently-fixed constant `TcRnMonad.mAX_CONTEXTS` which says how many layers of "In ..." to print. That could easily be made into a `DynFlag`. So there you are: two fairly easy-to-implement ideas. The relevant function is `TcRnMonad.add_err_tcm`. Anyone want to try this? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9672#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler