Commit 98f8e1c2 authored by Roland Senn's avatar Roland Senn Committed by Krzysztof Gogolewski
Browse files

Respect naming conventions in module RnUnbound.hs in fix for #15611

Summary:
The patch https://phabricator.haskell.org/D5284
didn't respect the local naming conventions in module
compiler/rename/RnUnbound.hs:

  - Top level functions names are written in camelCase.
  -  Local function names in where clauses are written as names_with_underscores.

This patch restores these conventions.

Test Plan: make test TESTS="T15611a T15611b"

Reviewers: DavidEichmann, monoidal, hvr, mpickering, bgamari

Reviewed By: mpickering

Subscribers: rwbarton, carter

GHC Trac Issues: #15611

Differential Revision: https://phabricator.haskell.org/D5308
parent b337906c
......@@ -238,7 +238,7 @@ importSuggestions where_look hpt currMod imports rdr_name
| not (isQual rdr_name || isUnqual rdr_name) = Outputable.empty
| null interesting_imports
, Just name <- mod_name
, showNotImportedLine (fromJust mod_name)
, show_not_imported_line name
= hsep
[ text "No module named"
, quotes (ppr name)
......@@ -341,18 +341,18 @@ importSuggestions where_look hpt currMod imports rdr_name
(helpful_imports_hiding, helpful_imports_non_hiding)
= partition (imv_is_hiding . snd) helpful_imports
-- See note [showNotImportedLine]
showNotImportedLine :: ModuleName -> Bool -- #15611
showNotImportedLine modnam
-- See note [When to show/hide the module-not-imported line]
show_not_imported_line :: ModuleName -> Bool -- #15611
show_not_imported_line modnam
| modnam `elem`
fmap moduleName (moduleEnvKeys (imp_mods imports)) = False -- 1
| moduleName currMod == modnam = False -- 2.1
| isLastLoadedMod modnam hptUniques = False -- 2.2
| otherwise = True
| moduleName currMod == modnam = False -- 2.1
| is_last_loaded_mod modnam hpt_uniques = False -- 2.2
| otherwise = True
where
hptUniques = map fst (udfmToList hpt)
isLastLoadedMod _ [] = False
isLastLoadedMod modnam uniqs = last uniqs == getUnique modnam
hpt_uniques = map fst (udfmToList hpt)
is_last_loaded_mod _ [] = False
is_last_loaded_mod modnam uniqs = last uniqs == getUnique modnam
extensionSuggestions :: RdrName -> SDoc
extensionSuggestions rdrName
......@@ -366,7 +366,7 @@ perhapsForallMsg
= vcat [ text "Perhaps you intended to use ExplicitForAll or similar flag"
, text "to enable explicit-forall syntax: forall <tvs>. <type>"]
{- Note [showNotImportedLine] -- #15611
{- Note [When to show/hide the module-not-imported line] -- #15611
For the error message:
Not in scope X.Y
Module X does not export Y
......
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