#2442: Heuristics to improve error messages for badly referenced things
------------------------------+---------------------------------------------
Reporter: batterseapower | Owner: simonpj
Type: feature request | Status: closed
Priority: high | Milestone: 7.0.2
Component: Compiler | Version: 6.9
Resolution: fixed | Keywords:
Testcase: | Blockedby:
Difficulty: Unknown | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
------------------------------+---------------------------------------------
Changes (by simonpj):
* status: patch => closed
* resolution: => fixed
Comment:
Finally done!
{{{
Wed Dec 22 17:51:24 GMT 2010 [email protected]
* Add fuzzyLookup, a variant of fuzzyMatch
Plus, I changed quite a bit of layout to make the lines shorter.
M ./compiler/utils/Util.lhs -33 +70
Wed Dec 22 17:54:00 GMT 2010 [email protected]
* Implement fuzzy matching for the Finder
..so that you get a more helpful message when
you mis-spell a module name in an 'import'.
Validates, but not fully tested.
Based on Max's patch in Trac #2442, but heavily refactored.
M ./compiler/main/Finder.lhs -45 +59
M ./compiler/main/HeaderInfo.hs -1 +2
M ./compiler/main/HscTypes.lhs -8 +16
M ./compiler/main/Packages.lhs -5 +27
Wed Dec 22 17:53:06 GMT 2010 [email protected]
* Implement fuzzy matching for the renamer
...so that you get helpful suggestions when you mis-spell a name
Based on Max's patch in Trac #2442, but heavily refactored.
M ./compiler/main/DynFlags.hs -1 +4
M ./compiler/rename/RnEnv.lhs -47 +176
M ./compiler/typecheck/TcRnMonad.lhs +4
Fri Jan 7 10:28:55 GMT 2011 [email protected]
* Make fuzzy matching a little less eager for short identifiers
For single-character identifiers we now don't make any suggestions
See comments in Util.fuzzyLookup
M ./compiler/utils/Util.lhs -3 +12
Thu Jan 13 11:12:33 GMT 2011 [email protected]
* Improve the finder's error messages
I'd done all the work to add fuzzy-match suggestions, but they
weren't really being used! Here's what you get now
module Foo where
import Data.Lst
Foo.hs:3:1:
Failed to load interface for `Data.Lst'
Perhaps you meant
Data.List (from base)
Data.List (needs flag -package haskell2010-1.0.0.0)
Data.Int (needs flag -package haskell2010-1.0.0.0)
Use -v to see a list of the files searched for.
M ./compiler/main/Finder.lhs -7 +28
}}}
Thanks to Max for doing most of the real work.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2442#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs