-- See Note [Looking up signature names]
lookupBindGroupOcc mb_bound_names what rdr_name
= do { local_env <- getLocalRdrEnv
- ; case lookupLocalRdrEnv local_env rdr_name of
- Just n -> check_local_name n
+ ; case lookupLocalRdrEnv local_env rdr_name of {
+ Just n -> check_local_name n;
Nothing -> do -- Not defined in a nested scope
{ env <- getGlobalRdrEnv
-- as a duplicate top-level binding for 'f'
[] | null gres -> bale_out_with empty
| otherwise -> bale_out_with import_msg
- }}
+ }}}
where
check_local_name name -- The name is in scope, and not imported
= case mb_bound_names of
lookupClassInstances :: TH.Name -> [TH.Type] -> TcM [TH.Name]
lookupClassInstances c ts
= do { loc <- getSrcSpanM
- ; case convertToHsPred loc (TH.ClassP c ts) of
- Left msg -> failWithTc msg
+ ; case convertToHsPred loc (TH.ClassP c ts) of {
+ Left msg -> failWithTc msg;
Right rdr_pred -> do
{ rn_pred <- rnLPred doc rdr_pred -- Rename
; kc_pred <- kcHsLPred rn_pred -- Kind check
; inst_envs <- tcGetInstEnvs
; let (matches, unifies) = lookupInstEnv inst_envs cls tys
dfuns = map is_dfun (map fst matches ++ unifies)
- ; return (map reifyName dfuns) } }
+ ; return (map reifyName dfuns) } } }
where
doc = ptext (sLit "TcSplice.classInstances")
\end{code}