missing export lists warning gives wrong line
Summary
When compiling a file that has LANGUAGE or OPTIONS_GHC pragmas at the top the warning -Wmissing-export-lists
gives the incorrect line number.
DB/Command.hs:1:1: error: [-Wmissing-export-lists, -Werror=missing-export-lists]
The export item ‘module DB.Command’ is missing an export list
|
1 | {-# LANGUAGE Unsafe #-}
| ^
Steps to reproduce
echo '{-# LANGUAGE Unsafe #-}\nmodule ABC where\n' > /tmp/mxl.hs
ghc -Wmissing-export-lists -Werror /tmp/mxl.hs
Expected behavior
Loaded package environment from /home/wjr/.ghc/x86_64-openbsd-9.2.7/environments/default
[1 of 1] Compiling ABC ( /tmp/mxl.hs, /tmp/mxl.o )
/tmp/mxl.hs:1:1: error: [-Wmissing-export-lists, -Werror=missing-export-lists]
The export item ‘module ABC’ is missing an export list
|
1 | {-# LANGUAGE Unsafe #-}
| ^
Environment
- GHC version used: 9.2.7
Optional:
- Operating System: OpenBSD 7.4
- System Architecture: x86_64