diff options
author | Wojciech Baranowski <wbaranowski@protonmail.com> | 2019-04-24 21:54:42 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-04-29 21:02:38 -0400 |
commit | 8ee474320d849cc14b51706892665376e8ede629 (patch) | |
tree | 38895dec1deef32a65f2638207d50c722ea907f6 /compiler | |
parent | 1deb2bb0c5f1178515d57380c96ec3d4df5a7965 (diff) | |
download | haskell-8ee474320d849cc14b51706892665376e8ede629.tar.gz |
Suggest only local candidates from global env
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/rename/RnEnv.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 2e0b7ec00a..436e34220f 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -1374,7 +1374,7 @@ However, consider this case: f :: Int -> Int g x = x We don't want to say 'f' is out of scope; instead, we want to -return the imported 'f', so that later on the reanamer will +return the imported 'f', so that later on the renamer will correctly report "misplaced type sig". Note [Signatures for top level things] @@ -1472,7 +1472,9 @@ lookupBindGroupOcc ctxt what rdr_name lookup_top keep_me = do { env <- getGlobalRdrEnv ; let all_gres = lookupGlobalRdrEnv env (rdrNameOcc rdr_name) - ; let candidates_msg = candidates $ map gre_name $ globalRdrEnvElts env + ; let candidates_msg = candidates $ map gre_name + $ filter isLocalGRE + $ globalRdrEnvElts env ; case filter (keep_me . gre_name) all_gres of [] | null all_gres -> bale_out_with candidates_msg | otherwise -> bale_out_with local_msg |