diff --git a/src/Cryptol/ModuleSystem/Renamer/Monad.hs b/src/Cryptol/ModuleSystem/Renamer/Monad.hs index d1de8556f..4da8e9463 100644 --- a/src/Cryptol/ModuleSystem/Renamer/Monad.hs +++ b/src/Cryptol/ModuleSystem/Renamer/Monad.hs @@ -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