[GHC] #12610: Emit tab warning promptly
GHC
ghc-devs at haskell.org
Thu Sep 22 19:36:27 UTC 2016
#12610: Emit tab warning promptly
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: bug | Status: new
Priority: high | Milestone: 8.0.2
Component: Compiler | Version: 8.0.1
(Parser) |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Incorrect
Unknown/Multiple | warning at compile-time
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
{{{#!hs
p = let x = 4
[tab]y = 5
in 12
}}}
produces `error: parse error on input ‘y’` and nothing else. The problem
is caused by a tab appearing to the user to line up `x` with `y` but
actually placing `y` in the wrong column. The user typically will scratch
their head and then post a question on StackOverflow. There they'll be
told to use `-fwarn-tabs`, but ''that option won't help'' (and it's
probably already on) because GHC will exit with a parse error before it
gets around to giving the warning. I suspect the solution is probably to
emit the tab warning in the lexer, but one of the parsing gurus will
probably know better.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12610>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list