Suggest similar names in imports
This commit adds similar name suggestions when importing. For example module A where { spelling = 'o' } module B where { import B ( speling ) } will give rise to the error message: Module ‘A’ does not export ‘speling’. Suggested fix: Perhaps use ‘spelling’ This also provides hints when users try to import record fields defined with NoFieldSelectors. (cherry picked from commit 1af2e773)
Showing
- compiler/GHC/Rename/Names.hs 48 additions, 16 deletionscompiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Unbound.hs 6 additions, 4 deletionscompiler/GHC/Rename/Unbound.hs
- compiler/GHC/Tc/Errors/Ppr.hs 2 additions, 2 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 1 addition, 1 deletioncompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Types/Hint.hs 1 addition, 1 deletioncompiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs 10 additions, 11 deletionscompiler/GHC/Types/Hint/Ppr.hs
- testsuite/tests/rename/should_fail/SimilarNamesImport.hs 3 additions, 0 deletionstestsuite/tests/rename/should_fail/SimilarNamesImport.hs
- testsuite/tests/rename/should_fail/SimilarNamesImport.stderr 16 additions, 0 deletionstestsuite/tests/rename/should_fail/SimilarNamesImport.stderr
- testsuite/tests/rename/should_fail/SimilarNamesImport_aux.hs 11 additions, 0 deletionstestsuite/tests/rename/should_fail/SimilarNamesImport_aux.hs
- testsuite/tests/rename/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/rename/should_fail/all.T
Loading
Please register or sign in to comment