Commit d81cdc22 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu
Browse files

Teach lookupLocalRdrEnv about Exacts. (#11813)

parent 0b6dcf6d
......@@ -357,8 +357,17 @@ extendLocalRdrEnvList lre@(LRE { lre_env = env, lre_in_scope = ns }) names
, lre_in_scope = extendNameSetList ns names }
lookupLocalRdrEnv :: LocalRdrEnv -> RdrName -> Maybe Name
lookupLocalRdrEnv (LRE { lre_env = env }) (Unqual occ) = lookupOccEnv env occ
lookupLocalRdrEnv _ _ = Nothing
lookupLocalRdrEnv (LRE { lre_env = env, lre_in_scope = ns }) rdr
| Unqual occ <- rdr
= lookupOccEnv env occ
-- See Note [Local bindings with Exact Names]
| Exact name <- rdr
, name `elemNameSet` ns
= Just name
| otherwise
= Nothing
lookupLocalRdrOcc :: LocalRdrEnv -> OccName -> Maybe Name
lookupLocalRdrOcc (LRE { lre_env = env }) occ = lookupOccEnv env occ
......
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