
#12146: syntax repair suggestion is too eager to suggest TemplateHaskell -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #7396 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): #7396 made 3 changes. The parser error message should suggest `TemplateHaskell` when a module contains at the toplevel: * `$foo` * `bar = 3 + $(x)` * `foo` The first two of those are fine. The third one is to handle this bit of obscure TemplateHaskell syntax:
You may omit the $(...) in a top-level declaration splice. Simply writing an expression (rather than a declaration) implies a splice.
The number of TemplateHaskell users who write modules using //only// this syntax, but who forget to add `LANGUAGE TemplateHaskell`, and who get confused about the new error message, should be much much smaller than those who get confused about the current error message for `ipmort Data.Monoid`. Furthermore, the comment in `T4042.hs` says that implicit splices without `-XTemplateHaskell` shouldn't lead to out of scope errors. Your new error message fits that criteria. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12146#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler