Skip to content

Commit

Permalink
Don't complain about shadowing yourself.
Browse files Browse the repository at this point in the history
Fixes #1060
  • Loading branch information
yav committed Feb 15, 2021
1 parent 074e445 commit 3db3b99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Cryptol/ModuleSystem/Renamer/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ checkEnv check (NamingEnv lenv) r rw0
{ rwWarnings =
if check == CheckAll
then case Map.lookup k (namespaceMap ns r) of
Just os | [x] <- xs ->
SymbolShadowed k x os : rwWarnings acc
Just os | [x] <- xs
, let os' = filter (/=x) os
, not (null os') ->
SymbolShadowed k x os' : rwWarnings acc
_ -> rwWarnings acc

else rwWarnings acc
Expand Down

0 comments on commit 3db3b99

Please sign in to comment.