Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
25b72d3e
Commit
25b72d3e
authored
Apr 26, 2009
by
Ian Lynagh
Browse files
Improve the error message when we find a module in 2 places; trac
#3183
parent
3572e8f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/main/Finder.lhs
View file @
25b72d3e
...
@@ -535,17 +535,20 @@ findObjectLinkable mod obj_fn obj_time = do
...
@@ -535,17 +535,20 @@ findObjectLinkable mod obj_fn obj_time = do
cannotFindModule :: DynFlags -> ModuleName -> FindResult -> SDoc
cannotFindModule :: DynFlags -> ModuleName -> FindResult -> SDoc
cannotFindModule = cantFindErr (sLit "Could not find module")
cannotFindModule = cantFindErr (sLit "Could not find module")
(sLit "Ambiguous module name")
cannotFindInterface :: DynFlags -> ModuleName -> FindResult -> SDoc
cannotFindInterface :: DynFlags -> ModuleName -> FindResult -> SDoc
cannotFindInterface = cantFindErr (sLit "Failed to load interface for")
cannotFindInterface = cantFindErr (sLit "Failed to load interface for")
(sLit "Ambiguous interface for")
cantFindErr :: LitString -> DynFlags -> ModuleName -> FindResult -> SDoc
cantFindErr :: LitString -> LitString -> DynFlags -> ModuleName -> FindResult
cantFindErr cannot_find _dflags mod_name (FoundMultiple pkgs)
-> SDoc
= hang (ptext cannot_find <+> quotes (ppr mod_name) <> colon) 2 (
cantFindErr _ multiple_found _ mod_name (FoundMultiple pkgs)
= hang (ptext multiple_found <+> quotes (ppr mod_name) <> colon) 2 (
sep [ptext (sLit "it was found in multiple packages:"),
sep [ptext (sLit "it was found in multiple packages:"),
hsep (map (text.packageIdString) pkgs)]
hsep (map (text.packageIdString) pkgs)]
)
)
cantFindErr cannot_find dflags mod_name find_result
cantFindErr cannot_find
_
dflags mod_name find_result
= hang (ptext cannot_find <+> quotes (ppr mod_name) <> colon)
= hang (ptext cannot_find <+> quotes (ppr mod_name) <> colon)
2 more_info
2 more_info
where
where
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment