Commit a12e47be authored by Eric Seidel's avatar Eric Seidel Committed by Austin Seipp
Browse files

Avoid panic due to partial ieName

HsImpExp.ieName is partial and fails when given e.g. `module X`

solution: use ieNames instead which returns a list of names instead of a single name.

Reviewed By: bgamari, austin

Differential Revision: https://phabricator.haskell.org/D1551

GHC Trac Issues: #11077
parent d4d54b46
......@@ -317,7 +317,7 @@ zonkTopDecls ev_binds binds export_ies sig_ns rules vects imp_specs fords
; warn_missing_sigs <- woptM Opt_WarnMissingSigs
; warn_only_exported <- woptM Opt_WarnMissingExportedSigs
; let export_occs = maybe emptyBag
(listToBag . map (rdrNameOcc . ieName . unLoc) . unLoc)
(listToBag . concatMap (map rdrNameOcc . ieNames . unLoc) . unLoc)
export_ies
sig_warn
| warn_only_exported = topSigWarnIfExported export_occs sig_ns
......
module T11077 (module X, foo) where
import Data.List as X
foo = undefined
T11077.hs:3:1: warning:
Top-level binding with no type signature: foo :: forall t. t
......@@ -4,6 +4,7 @@ test('T9178', extra_clean(['T9178.o', 'T9178DataType.o',
'T9178.hi', 'T9178DataType.hi']),
multimod_compile, ['T9178', '-Wall'])
test('T9230', normal, compile_without_flag('-fno-warn-tabs'), [''])
test('T11077', normal, compile, ['-fwarn-missing-exported-sigs'])
test('T11128', normal, compile, [''])
test('DeprU',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment