- ; let ((orig_env', occ_env, subst_env), tidy_binds)
+ -- We also make sure to avoid any exported binders. Consider
+ -- f{-u1-} = 1 -- Local decl
+ -- ...
+ -- f{-u2-} = 2 -- Exported decl
+ --
+ -- The second exported decl must 'get' the name 'f', so we
+ -- have to put 'f' in the avoids list before we get to the first
+ -- decl. tidyTopId then does a no-op on exported binders.
+ ; let prs = pcs_PRS pcs
+ orig_ns = prsOrig prs
+
+ init_tidy_env = (orig_ns, initTidyOccEnv avoids, emptyVarEnv)
+ avoids = [getOccName bndr | bndr <- bindersOfBinds binds_in,
+ isGlobalName (idName bndr)]
+
+ ; let ((orig_ns', occ_env, subst_env), tidy_binds)