Bad error message: <no location info> for a known main module
Summary
When main-is
file contains module
header declaring module name other than Main
, a user gest misleading message:
<no location info>: error:
output was redirected with -o, but no output will be generated
because there is no Main module.
- The real cause is the wrong main module name.
- Location info presents — it's known from
main-is
.
Steps to reproduce
-- foo.cabal
executable foo
main-is: Foo.hs
-- Foo.hs
module Foo where
Expected behavior
An error message like:
main-is directive does not match module name:
Saw: ‘Foo’
Expected: ‘Main’
Environment
- GHC version used: 8.8.3, 8.10.1