Skip to content

shebang + literate haskell causes line numbering skew

Noticed on doctest's Setup.lhs file. Minimal example:

#!/usr/bin/env runhaskell
> main = return ()
$ inplace/bin/ghc-stage2 -fforce-recomp -Wall Setup
[1 of 1] Compiling Main             ( Setup.lhs, Setup.o )

Setup.lhs:1:3: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO ()
  |
1 | #!/usr/bin/env runhaskell
  |   ^^^^

Notice how it points 4 characters a line before main.

Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information